sshChat-CLI/commands/cd.js
2023-01-11 15:48:57 -05:00

14 lines
342 B
JavaScript

async function changeDir(commandArgs, USERPWD) {
let newDir;
if (commandArgs.startsWith("/")) {
newDir = commandArgs;
console.log("Directory Changed to: " + newDir)
} else {
newDir = USERPWD + "/" + commandArgs;
console.log("Directory Changed to: " + newDir)
}
return newDir;
}
module.exports = { changeDir }