Skip to content

Commit

Permalink
do some start work
Browse files Browse the repository at this point in the history
  • Loading branch information
saqqdy committed Jan 9, 2020
1 parent ffb0e02 commit 00cd64d
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
package-lock.json
yarn.lock

.idea
.git
25 changes: 25 additions & 0 deletions bin/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env node
const set = require('./../package.json');
const program = require('commander');
const shell = require('shelljs');
const log = require('tracer').colorConsole();
if (!shell.which('git')) {
shell.echo('Sorry, this script requires git');
shell.exit(1);
}

program
.version('v' + set.version)
.option('-m, --merge', 'Add peppers')
.option('-r, --release', 'Add pineapple')
.option('-, --bbq-sauce', 'Add bbq sauce')
.option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'release')
.parse(process.argv);

let pwd = shell.pwd() + '';
console.log(pwd)
console.log('你输入了以下指令:');
if (program.peppers) console.log(' - peppers');
if (program.pineapple) console.log(' - pineapple'); // shell.touch('2.js');shell.cp('2.js', '1.js');
if (program.bbqSauce) console.log(' - bbq');
console.log(' - %s', program.cheese);
33 changes: 33 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "gitman",
"description": "git tool for newbes",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"bin": {
"gitm": "./bin/index.js"
},
"dependencies": {
"commander": "^4.1.0",
"shelljs": "^0.8.3",
"tracer": "^1.0.2"
},
"devDependencies": {},
"repository": {
"type": "git",
"url": "git+https://github.com/saqqdy/gitman.git"
},
"keywords": [
"gitman",
"git",
"tool"
],
"author": "saqqdy.com",
"license": "ISC",
"bugs": {
"url": "https://github.com/saqqdy/gitman/issues"
},
"homepage": "https://github.com/saqqdy/gitman#readme"
}

0 comments on commit 00cd64d

Please sign in to comment.