diff options
| author | hachem <im@hachem.wtf> | 2026-10-08 11:50:02 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-10-08 11:50:02 +0200 |
| commit | ef104148057ab98f80b1560405b5c02768457096 (patch) | |
| tree | 47e75bc81aacb2e035e7cd43be9616b677b01d04 /gils/mv.rv | |
| parent | 5f6deca073728d0dafa2cd47d841b28d54af3aaf (diff) | |
feat: colors + better ps1
Diffstat (limited to 'gils/mv.rv')
| -rw-r--r-- | gils/mv.rv | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,12 +1,12 @@ # move or rename a file const context = env.ctx -if context.argv:len() < 3 do puts("usage: mv <source> <destination>\n") end +if context.argv:len() < 3 do fail("usage: mv <source> <destination>\n") end else do const source = expand_path(context.argv[1]) const destination = expand_path(context.argv[2]) const size = fs:size(source) - if size < 0 do puts("mv: #{source}: no such file\n") end + if size < 0 do fail("mv: #{source}: no such file\n") end else do const contents = if size > 0 fs:read_bytes(source, 0, size) else "" if fs:store(destination, contents) == 1 do fs:unlink(source) puts("#{source} -> #{destination}\n") end |
