chore: fix path syntax in core programs
This commit is contained in:
@@ -13,11 +13,8 @@ export class Mkdir extends Program {
|
||||
return 1
|
||||
}
|
||||
|
||||
const item = await Item.openDir(args[1].startsWith('/')
|
||||
? args[1]
|
||||
: `${workdir.GetPath()}${workdir.GetPath().endsWith('/') ? '' : '/'}${args[1]}`)
|
||||
const item = await Item.openDir(Item.NormalizePath(args[1].startsWith('/') ? args[1] : `${workdir.GetPath()}/${args[1]}`))
|
||||
|
||||
stdout.emit(`does ${args[1]} exist? ${await item.Exists()}\n`)
|
||||
|
||||
if (await item.Exists()) {
|
||||
stdout.emit(`mkdir: directory ${item.GetPath()} already exists.\n`)
|
||||
|
||||
Reference in New Issue
Block a user