function buildCommand()

in Tasks/codepush-release/codepush-release.js [14:35]


function buildCommand(cmd, positionArgs, optionFlags) {
  var command = codePushCommandPrefix + " " + cmd;
  
  positionArgs && positionArgs.forEach(function(positionArg) {
    command = command + " \"" + positionArg + "\"";
  });
  
  for (var flag in optionFlags) {
    // If the value is falsey, the option flag doesn't have to be specified.
    if (optionFlags[flag]) {
      var flagValue = "" + optionFlags[flag];
      
      command = command + " --" + flag;
      // For boolean flags, the presence of the flag is enough to indicate its value.
      if (flagValue != "true" && flagValue != "false") {
        command = command + " \"" + flagValue + "\"";
      }
    }
  }

  return command;
}