Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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) {
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);
}
);
}
}
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
}
}
})
}
return new Promise((resolve, reject) => {
cmd.get(
cmd_string,
(data, err, stderr) => {
if ( err ) {
console.log(err)
}
if ( stderr ) {
console.log(stderr)
}
resolve(data)
}
)
})
}
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);
}
return new Promise((resolve, reject) => {
let cmdStr = checkOS(arr, os.type());
nodeCmd.get(cmdStr, err => {
err ? reject(err) : resolve(cmdStr);
});
});
}
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);
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')
})
})
})
cmd.get('git add --all && git commit -m "Publish ' + version + ' release :rocket:"', (err) => {
if (err) { throw(err); }
cmd.get('git push')
})
})