forked from rw251/git-summary
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgit-summary.js
More file actions
21 lines (16 loc) · 799 Bytes
/
git-summary.js
File metadata and controls
21 lines (16 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env node
const args = process.argv.slice(2);
const options = args[0]; // options
const dir = args[1]; // dir to check
const workingDirectory = process.cwd(); // if no dir is passed, will default to the working directory where command was executed
const path = require('path') // npm install path
const installationDir = path.dirname(require.resolve('git-summary/package.json')) // installation path of the module
const shell = require('shelljs');
const run = (options = '', path = workingDirectory) => {
if (!options) { // if there are no options. set options to be same as path
options = path;
}
// console.log(`Executing: '${installationDir}/git-summary.sh ${options} ${path}'`)
shell.exec(`${installationDir}/git-summary.sh ${options} ${path}`);
}
run(options, dir);