ProzillaOS/packages/apps/terminal/core/commands/pwd.ts
2024-06-16 21:46:44 +02:00

15 lines
No EOL
357 B
TypeScript

import { Command, ExecuteParams } from "../command";
export const pwd = new Command()
.setManual({
purpose: "Display path of the current directory"
})
.setExecute(function(args, params) {
const { currentDirectory } = params as ExecuteParams;
if (currentDirectory.root) {
return "/";
} else {
return currentDirectory.absolutePath;
}
});