git-history/cli/cli.js
2019-02-18 00:52:09 -03:00

22 lines
335 B
JavaScript
Executable File

#!/usr/bin/env node
const runServer = require("./server");
const fs = require("fs");
let path = process.argv[2] || "./.";
if (path === "--help") {
console.log(`Usage:
githistory some/file.ext
`);
process.exit();
}
if (!fs.existsSync(path)) {
console.log(`File not found: ${path}`);
process.exit();
}
runServer(path);