Created
June 16, 2019 11:13
-
-
Save r0hnx/447b951aa007dd2af64f1bf47707a68a to your computer and use it in GitHub Desktop.
initial JavaScript file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const child = require('child_process'); | |
const path = require('path'); | |
function git() { | |
child.spawnSync('sh', ['-c', `sh ${path.resolve(__dirname)}/.github.sh`], { | |
stdio: 'inherit', | |
stdin: 'inherit' | |
}); | |
} | |
function pro_del() { | |
child.spawnSync('sh', ['-c', `sh ${path.resolve(__dirname)}/.pro_del.sh`], { | |
stdio: 'inherit', | |
stdin: 'inherit' | |
}); | |
} | |
module.exports = function () { | |
child.exec('dpkg -l | grep hub', (err, out) => { | |
if (out == '') { | |
console.log('Installing Requirements... Working'); | |
pro_del(); | |
return git(); | |
} else | |
return git(); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const program = require('commander'); | |
const init = require('../lib/init'); | |
const device = require('../lib/device'); | |
const github = require('../lib/github'); | |
program | |
.option('-i, --init', 'Initialize Project') | |
.option('-d, --device', 'Device Information') | |
.option('-g, --github', 'Git Remote Repository Creation') | |
.parse(process.argv); | |
if (program.init) { | |
init(); | |
} | |
if (program.device) { | |
device(); | |
} | |
if (program.github) { | |
github(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment