sshChat-CLI/commands/cd.js

14 lines
342 B
JavaScript
Raw Normal View History

2023-01-11 15:48:57 -05:00
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 }