rm js fns
This commit is contained in:
10
link.ce
10
link.ce
@@ -108,11 +108,11 @@ if (cmd == 'list') {
|
||||
// Resolve target if it's a local path
|
||||
if (target == '.' || fd.is_dir(target)) {
|
||||
target = fd.realpath(target)
|
||||
} else if (target.startsWith('./') || target.startsWith('../')) {
|
||||
} else if (starts_with(target, './') || starts_with(target, '../')) {
|
||||
// Relative path that doesn't exist yet - try to resolve anyway
|
||||
var cwd = fd.realpath('.')
|
||||
if (target.startsWith('./')) {
|
||||
target = cwd + target.substring(1)
|
||||
if (starts_with(target, './')) {
|
||||
target = cwd + text(target, 1)
|
||||
} else {
|
||||
// For ../ paths, var fd.realpath handle it if possible
|
||||
target = fd.realpath(target) || target
|
||||
@@ -127,7 +127,7 @@ if (cmd == 'list') {
|
||||
// Resolve path
|
||||
if (target == '.' || fd.is_dir(target)) {
|
||||
target = fd.realpath(target)
|
||||
} else if (target.startsWith('./') || target.startsWith('../')) {
|
||||
} else if (starts_with(target, './') || starts_with(target, '../')) {
|
||||
target = fd.realpath(target) || target
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ if (cmd == 'list') {
|
||||
}
|
||||
|
||||
// Validate: if target is a local path, it must have cell.toml
|
||||
if (target.startsWith('/')) {
|
||||
if (starts_with(target, '/')) {
|
||||
if (!fd.is_file(target + '/cell.toml')) {
|
||||
log.console("Error: " + target + " is not a valid package (no cell.toml)")
|
||||
$stop()
|
||||
|
||||
Reference in New Issue
Block a user