switch to length fn
This commit is contained in:
18
list.ce
18
list.ce
@@ -13,7 +13,7 @@ var fd = use('fd')
|
||||
var mode = 'local'
|
||||
var target_pkg = null
|
||||
|
||||
if (args && args.length > 0) {
|
||||
if (args && length(args) > 0) {
|
||||
if (args[0] == 'shop') {
|
||||
mode = 'shop'
|
||||
} else if (args[0] == '--help' || args[0] == '-h') {
|
||||
@@ -62,12 +62,12 @@ function print_deps(ctx, indent) {
|
||||
for (var k in deps) aliases.push(k)
|
||||
aliases = sort(aliases)
|
||||
|
||||
if (aliases.length == 0) {
|
||||
if (length(aliases) == 0) {
|
||||
log.console(indent + " (none)")
|
||||
return
|
||||
}
|
||||
|
||||
for (var i = 0; i < aliases.length; i++) {
|
||||
for (var i = 0; i < length(aliases); i++) {
|
||||
var alias = aliases[i]
|
||||
var locator = deps[alias]
|
||||
var link_target = links[locator]
|
||||
@@ -93,7 +93,7 @@ function print_deps(ctx, indent) {
|
||||
status.push("not installed")
|
||||
}
|
||||
|
||||
if (status.length > 0) {
|
||||
if (length(status) > 0) {
|
||||
line += " [" + text(status, ", ") + "]"
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ if (mode == 'local') {
|
||||
log.console("")
|
||||
|
||||
var packages = shop.list_packages()
|
||||
if (packages.length == 0) {
|
||||
if (length(packages) == 0) {
|
||||
log.console(" (none)")
|
||||
} else {
|
||||
packages = sort(packages)
|
||||
@@ -136,7 +136,7 @@ if (mode == 'local') {
|
||||
}
|
||||
})
|
||||
|
||||
if (linked_pkgs.length > 0) {
|
||||
if (length(linked_pkgs) > 0) {
|
||||
log.console("Linked packages:")
|
||||
arrfor(linked_pkgs, function(p) {
|
||||
var target = links[p]
|
||||
@@ -145,7 +145,7 @@ if (mode == 'local') {
|
||||
log.console("")
|
||||
}
|
||||
|
||||
if (local_pkgs.length > 0) {
|
||||
if (length(local_pkgs) > 0) {
|
||||
log.console("Local packages:")
|
||||
arrfor(local_pkgs, function(p) {
|
||||
log.console(" " + p)
|
||||
@@ -153,7 +153,7 @@ if (mode == 'local') {
|
||||
log.console("")
|
||||
}
|
||||
|
||||
if (remote_pkgs.length > 0) {
|
||||
if (length(remote_pkgs) > 0) {
|
||||
log.console("Remote packages:")
|
||||
arrfor(remote_pkgs, function(p) {
|
||||
var lock_entry = lock[p]
|
||||
@@ -163,7 +163,7 @@ if (mode == 'local') {
|
||||
log.console("")
|
||||
}
|
||||
|
||||
log.console("Total: " + text(packages.length) + " package(s)")
|
||||
log.console("Total: " + text(length(packages)) + " package(s)")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user