improved fetch
This commit is contained in:
55
fetch.ce
55
fetch.ce
@@ -14,33 +14,36 @@ var i = 0
|
||||
var packages = null
|
||||
var count = 0
|
||||
|
||||
for (i = 0; i < length(args); i++) {
|
||||
if (args[i] == '--help' || args[i] == '-h') {
|
||||
log.console("Usage: cell fetch [package]")
|
||||
log.console("Sync packages from remote sources.")
|
||||
log.console("")
|
||||
log.console("Arguments:")
|
||||
log.console(" package Optional package to sync. If omitted, syncs all.")
|
||||
$stop()
|
||||
} else if (!starts_with(args[i], '-')) {
|
||||
target_pkg = args[i]
|
||||
var run = function() {
|
||||
for (i = 0; i < length(args); i++) {
|
||||
if (args[i] == '--help' || args[i] == '-h') {
|
||||
log.console("Usage: cell fetch [package]")
|
||||
log.console("Sync packages from remote sources.")
|
||||
log.console("")
|
||||
log.console("Arguments:")
|
||||
log.console(" package Optional package to sync. If omitted, syncs all.")
|
||||
return
|
||||
} else if (!starts_with(args[i], '-')) {
|
||||
target_pkg = args[i]
|
||||
}
|
||||
}
|
||||
|
||||
if (target_pkg) {
|
||||
target_pkg = shop.resolve_locator(target_pkg)
|
||||
log.console("Syncing " + target_pkg + "...")
|
||||
shop.sync(target_pkg)
|
||||
log.console("Done.")
|
||||
} else {
|
||||
packages = shop.list_packages()
|
||||
count = 0
|
||||
arrfor(packages, function(pkg) {
|
||||
if (pkg == 'core') return
|
||||
shop.sync(pkg)
|
||||
count = count + 1
|
||||
})
|
||||
log.console("Synced " + text(count) + " package(s).")
|
||||
}
|
||||
}
|
||||
|
||||
if (target_pkg) {
|
||||
target_pkg = shop.resolve_locator(target_pkg)
|
||||
log.console("Syncing " + target_pkg + "...")
|
||||
shop.sync(target_pkg)
|
||||
log.console("Done.")
|
||||
} else {
|
||||
packages = shop.list_packages()
|
||||
count = 0
|
||||
arrfor(packages, function(pkg) {
|
||||
if (pkg == 'core') return
|
||||
shop.sync(pkg)
|
||||
count = count + 1
|
||||
})
|
||||
log.console("Synced " + text(count) + " package(s).")
|
||||
}
|
||||
run()
|
||||
|
||||
$stop()
|
||||
|
||||
Reference in New Issue
Block a user