Skip to content

Instantly share code, notes, and snippets.

@r0hnx
Created June 16, 2019 11:13
Show Gist options
  • Save r0hnx/447b951aa007dd2af64f1bf47707a68a to your computer and use it in GitHub Desktop.
Save r0hnx/447b951aa007dd2af64f1bf47707a68a to your computer and use it in GitHub Desktop.
initial JavaScript file
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();
});
}
#!/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