From 6d41e590a38c73ef60f1c04beaf8f5438f350f46 Mon Sep 17 00:00:00 2001 From: Agando Date: Tue, 2 Jun 2026 06:00:29 +0200 Subject: auto: 2026-06-02_06:00 changes --- modules/core/module-fs.js | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) (limited to 'modules/core/module-fs.js') diff --git a/modules/core/module-fs.js b/modules/core/module-fs.js index ae8b5f4..da2e740 100644 --- a/modules/core/module-fs.js +++ b/modules/core/module-fs.js @@ -148,37 +148,17 @@ class FileSystemModule { }; this.commands['mv'] = (args) => { if(!args[0] || !args[1]) return this.terminal.print('Usage: mv ', 'warning'); - const srcDir = this.terminal.fs.readDir(args[0]); - if (srcDir !== null) { - if (this.terminal.fs.moveDir(args[0], args[1])) { - this.terminal.print('Moved directory: ' + args[0] + ' to ' + args[1], 'success'); - } else { - this.terminal.print('mv: ' + args[0] + ': failed to move directory', 'error'); - } - return; - } - if (this.terminal.fs.moveFile(args[0], args[1])) { + if (this.terminal.fs.mv(args[0], args[1])) this.terminal.print('Moved: ' + args[0] + ' to ' + args[1], 'success'); - } else { + else this.terminal.print('mv: ' + args[0] + ': No such file or directory', 'error'); - } }; this.commands['cp'] = (args) => { if(!args[0] || !args[1]) return this.terminal.print('Usage: cp ', 'warning'); - const srcDir = this.terminal.fs.readDir(args[0]); - if (srcDir !== null) { - if (this.terminal.fs.copyDir(args[0], args[1])) { - this.terminal.print('Copied directory: ' + args[0] + ' to ' + args[1], 'success'); - } else { - this.terminal.print('cp: ' + args[0] + ': failed to copy directory', 'error'); - } - return; - } - if (this.terminal.fs.copyFile(args[0], args[1])) { + if (this.terminal.fs.cp(args[0], args[1])) this.terminal.print('Copied: ' + args[0] + ' to ' + args[1], 'success'); - } else { + else this.terminal.print('cp: ' + args[0] + ': No such file or directory', 'error'); - } }; this.commands['cd'] = (args) => { if (!args[0] || args[0] === '/') { -- cgit v1.2.3