How to use the node-cmd.get function in node-cmd

To help you get started, we’ve selected a few node-cmd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PortalNetwork / kaizen-cli / build / lib / plugin / add.js View on Github external
function handleNOIA(kaizenConfig) {
  try {
    var checkResult = packageChecker(kaizenConfig);

    if (checkResult.isValid === false) {
      console.error('[ERROR]: please use kaizen new to create new project first');
      return;
    }

    console.log('kaizen: installing noia sdk...'); // clone noia sdk repo and copy out packages

    cmd.get('git clone https://github.com/noia-network/sdk.git temp-noia-sdk', function (error) {
      if (error) {
        handleError(error);
        return;
      }

      ncp('./temp-noia-sdk/packages', './', function (error) {
        if (error) {
          handleError(error);
          return;
        }

        cmd.run('rm -rf ./temp-noia-sdk');
        updateConfig(kaizenConfig, 'NOIA');
      });
    });
  } catch (error) {
github amit-upadhyay-IT / crypt-git / index.js View on Github external
function doPushOperation()
{
    if (commitMessage === '')
        commitMessage = 'Commit via crypt-git';
    var msg = 'git add -A && git commit -m "'+commitMessage+'" && git push -u origin master';
    //var msg = 'git add -A && git commit -m \''+commitMessage+'\' && git push -u origin master';

    if (theReqCmd !== '')// just a normal check if user wants to push or not
    {
        // an async operation because it is required.
        cmd.get(
        msg,
            function(err, data, stderr) {
                if (err)
                {
                    // if the push fails then I need to restore the previous iv otherwise it will give error in decrypting and decompressing
                    console.log(err);
                }
                else
                    console.log(data);
            }
        );
    }
}
github nainemom / nosy-detector / src / index.js View on Github external
console.log(faces, _faces, tryOver)
    }
    if (faces !== _faces) {
      // something new happened
      if (tryOver.length === faces) {
        // this is not first time
        tryOver.times++
        if (tryOver.times > 2) {
          // set trusted total faces
          _faces = faces
          console.log(Date(), `${faces} Face(s) Detected!`)
          if (outputdir.trim() !== 'null') {
            im.save(path.join(absoluteOutputDir, `${Date.now()}-${faces}.jpg`))
          }
          if (faces > availablePersons) {
            runningCmd = cmd.get(command)
          } else if (runningCmd) {
            cmd.get(`kill ${runningCmd.pid + 1}`)
          }
        }
      } else {
        // reset try times
        tryOver.length = faces
        tryOver.times = 0
      }
    }
  })
}
github appleple / SmartPhoto / tools / index.js View on Github external
return new Promise((resolve, reject) => {
    cmd.get(
      cmd_string,
      (data, err, stderr) => {
        if ( err ) {
          console.log(err)
        }
        if ( stderr ) {
          console.log(stderr)
        }
        resolve(data)
      }
    )
  })
}
github TimDurward / xfinity-wifi-hack / index.js View on Github external
setTimeout(function () {
        CMD.get(
            'sudo spoof randomize ' + DRIVER_INTERFACE,
            function (data) {
                macaddress.one(DRIVER_INTERFACE, function (err, mac) {
                    console.log("Generated temporary Mac address for " + DRIVER_INTERFACE + ": %s", mac);
                    var macAdr = mac;
                    callback(null, macAdr);
                });
            }
        );
    }, 15000);
}
github codexu / x-build / lib / cmd.js View on Github external
return new Promise((resolve, reject) => {
    let cmdStr = checkOS(arr, os.type());
    nodeCmd.get(cmdStr, err => {
      err ? reject(err) : resolve(cmdStr);
    });
  });
}
github RedpointGames / pkgsign / dist / lib / keybaseSIgner.js View on Github external
const keybaseSignature = yield new Promise((resolve, reject) => {
                cmd.get('keybase pgp sign --detached -i "' + fileToSignPath + '"', (err, data, stderr) => {
                    if (err) {
                        reject(err);
                    }
                    else {
                        resolve(data);
                    }
                });
            });
            yield fsPromise_1.unlinkPromise(fileToSignPath);
github materik / sketchplugin-pixelperfect / scripts / release.js View on Github external
cmd.get('skpm publish ' + release, (err) => {
    if (err) { throw(err); }
    cmd.get('npm run update-readme', (err) => {
        if (err) { throw(err); }
        var version = json(PACKAGE_FILE).get('version');
        cmd.get('git add --all && git commit -m "Publish ' + version + ' release :rocket:"', (err) => {
            if (err) { throw(err); }
            cmd.get('git push')
        })
    })
})
github materik / sketchplugin-pixelperfect / scripts / release.js View on Github external
cmd.get('git add --all && git commit -m "Publish ' + version + ' release :rocket:"', (err) => {
            if (err) { throw(err); }
            cmd.get('git push')
        })
    })

node-cmd

Simple commandline/terminal/shell interface to allow you to run cli or bash style commands as if you were in the terminal.

MIT
Latest version published 3 years ago

Package Health Score

54 / 100
Full package analysis

Popular node-cmd functions