git-history/cli/cli.js

22 lines
335 B
JavaScript
Raw Normal View History

2019-02-10 22:59:26 +03:00
#!/usr/bin/env node
2019-02-18 06:52:09 +03:00
const runServer = require("./server");
2019-02-10 23:19:11 +03:00
const fs = require("fs");
2019-02-10 05:21:05 +03:00
2019-02-18 06:52:09 +03:00
let path = process.argv[2] || "./.";
2019-02-10 23:19:11 +03:00
2019-02-18 03:55:40 +03:00
if (path === "--help") {
2019-02-10 23:19:11 +03:00
console.log(`Usage:
githistory some/file.ext
`);
process.exit();
}
if (!fs.existsSync(path)) {
console.log(`File not found: ${path}`);
process.exit();
}
2019-02-10 05:21:05 +03:00
2019-02-18 03:55:40 +03:00
runServer(path);