Uname: Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
Software: LiteSpeed
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.213.251.212
Your Ip: 18.191.13.203
User: allssztx (535) | Group: allssztx (533)
Safe Mode: OFF
Disable Function:
NONE

name : command.js
module.exports = command;

/**
 * command constructs the executable command to run in a shell including the
 * user script, the command arguments.
 *
 * @param  {Object} settings Object as:
 *                           { execOptions: {
 *                               exec: String,
 *                               [script: String],
 *                               [scriptPosition: Number],
 *                               [execArgs: Array<string>]
 *                             }
 *                           }
 * @return {Object}          an object with the node executable and the
 *                           arguments to the command
 */
function command(settings) {
  var options = settings.execOptions;
  var executable = options.exec;
  var args = [];

  // after "executable" go the exec args (like --debug, etc)
  if (options.execArgs) {
    [].push.apply(args, options.execArgs);
  }

  // then goes the user's script arguments
  if (options.args) {
    [].push.apply(args, options.args);
  }

  // after the "executable" goes the user's script
  if (options.script) {
    args.splice((options.scriptPosition || 0) +
      options.execArgs.length, 0, options.script);
  }

  return {
    executable: executable,
    args: args,
  };
}
© 2025 GrazzMean-Shell