chore: fix path syntax in core programs

This commit is contained in:
binekrasik
2026-05-19 23:19:36 +02:00
parent 1d00cf6deb
commit b5089251ff
9 changed files with 42 additions and 51 deletions

View File

@@ -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`)