@filemonger/cli
Advanced tools
Comparing version 0.2.3 to 0.5.0
26
index.js
#!/usr/bin/env node | ||
const { join } = require("path"); | ||
const { ensureDir } = require("fs-extra"); | ||
const yargs = require("yargs"); | ||
const argv = yargs | ||
.option("src", { | ||
alias: "s", | ||
describe: "Source directory to pull files from", | ||
type: "string" | ||
}) | ||
.option("dest", { | ||
@@ -17,5 +13,4 @@ alias: "d", | ||
}) | ||
.demandOption(["src", "dest"]).argv; | ||
.demandOption(["dest"]).argv; | ||
const srcDir = argv.src; | ||
const destDir = argv.dest; | ||
@@ -25,11 +20,18 @@ | ||
console.log("Filemongering..."); | ||
console.time("Time"); | ||
mongerfile.run(srcDir, destDir, (err, files) => { | ||
console.timeEnd("Time"); | ||
ensureDir(destDir, err => { | ||
if (err) { | ||
console.error(err); | ||
process.exit(1); | ||
return; | ||
} | ||
console.time("Filemonger"); | ||
mongerfile.run(destDir, err => { | ||
console.timeEnd("Filemonger"); | ||
if (err) { | ||
console.error(err); | ||
process.exit(1); | ||
} | ||
}); | ||
}); |
{ | ||
"name": "@filemonger/cli", | ||
"version": "0.2.3", | ||
"version": "0.5.0", | ||
"description": "Filemonger CLI", | ||
@@ -5,0 +5,0 @@ "bin": { |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
28
2096
3