46 lines
1.2 KiB
Plaintext
46 lines
1.2 KiB
Plaintext
// cell update [alias] - Update packages to latest versions and rebuild dynamic libraries
|
|
//
|
|
// This command:
|
|
// 1. Updates all packages from their remote sources
|
|
// 2. Rebuilds all dynamic libraries via 'cell build -d'
|
|
|
|
var shop = use('shop')
|
|
var os = use('os')
|
|
|
|
var target = null
|
|
|
|
// Parse arguments
|
|
for (var i = 0; i < args.length; i++) {
|
|
if (args[i] == '--target' || args[i] == '-t') {
|
|
if (i + 1 < args.length) {
|
|
target = args[i + 1]
|
|
i++
|
|
}
|
|
} else if (args[i] == '--help' || args[i] == '-h') {
|
|
log.console("Usage: cell update [options]")
|
|
log.console("Update packages and rebuild dynamic libraries.")
|
|
log.console("")
|
|
log.console("Options:")
|
|
log.console(" --target, -t <target> Build for specific target platform")
|
|
log.console("")
|
|
log.console("This command updates all installed packages from their remote")
|
|
log.console("sources, then rebuilds all dynamic libraries.")
|
|
$_.stop()
|
|
}
|
|
}
|
|
|
|
var packages = shop.list_shop_packages()
|
|
|
|
log.console("Checking for updates (" + packages.length + " packages)...")
|
|
|
|
// 1. Update all packages
|
|
for (var info of packages) {
|
|
var pack = info.package
|
|
if (!pack || pack == 'core') continue
|
|
|
|
log.console("Updating " + pack)
|
|
shop.update(pack)
|
|
}
|
|
|
|
$_.stop()
|