29 lines
651 B
Plaintext
29 lines
651 B
Plaintext
// cell replace [package] [path]
|
|
// replace a package with a local directory
|
|
|
|
var shop = use('shop')
|
|
|
|
if (args.length < 2) {
|
|
log.console("Usage: cell replace <package> <path>")
|
|
log.console(" cell replace <package> --remove")
|
|
$_.stop()
|
|
}
|
|
|
|
var pkg = args[0]
|
|
var path = args[1]
|
|
|
|
if (path == '--remove') {
|
|
if (shop.remove_replacement(pkg)) {
|
|
log.console("Replacement removed.")
|
|
} else {
|
|
log.console("Failed to remove replacement.")
|
|
}
|
|
} else {
|
|
if (shop.add_replacement(pkg, path)) {
|
|
log.console("Replacement added.")
|
|
} else {
|
|
log.console("Failed to add replacement.")
|
|
}
|
|
}
|
|
|
|
$_.stop() |