• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3var escapeArgument = require('./escapeArgument');
4
5function escapeCommand(command) {
6    // Do not escape if this command is not dangerous..
7    // We do this so that commands like "echo" or "ifconfig" work
8    // Quoting them, will make them unaccessible
9    return /^[a-z0-9_-]+$/i.test(command) ? command : escapeArgument(command, true);
10}
11
12module.exports = escapeCommand;
13