nodejs-bash-completion/myUpdateSubCommand

32 lines
782 B
JavaScript
Executable File

#!/usr/bin/env node
const This = require('./this');
const shell = require('shelljs');
class MyUpdateSubCommand extends This {
constructor() {
super();
this.version = '0.0.1';
}
start() {
// Usage
const myUpdateSubCommand = new MyUpdateSubCommand();
// Output: Methods of ExampleClass: [ 'methodOne', 'methodTwo' ]
// Properties of ExampleClass: [ 'propertyOne', 'propertyTwo', 'version' ] and Version: 1.1.0
// myUpdateSubCommand.discover();
if (!shell.which('git')) {
shell.echo('Sorry, this script requires git');
shell.exit(1);
} else {
shell.echo('Woohoo! You have git installed!');
shell.exit(0);
}
}
}
// main
const myUpdateSubCommand = new MyUpdateSubCommand();
myUpdateSubCommand.start();