| Current Path : /var/www/html/wetty/src/server/command/ |
| Current File : /var/www/html/wetty/src/server/command/parse.ts |
import { isUndefined } from 'lodash';
export default function parseCommand(command: string, path?: string): string {
if (command === 'login' && isUndefined(path)) return '';
return !isUndefined(path)
? `$SHELL -c "cd ${path};${command === 'login' ? '$SHELL' : command}"`
: command;
}