Your IP : 216.73.216.40


Current Path : /var/www/html/wetty/src/server/command/
Upload File :
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;
}