asset-assistant
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "asset-assistant", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"keywords": [ | ||
@@ -5,0 +5,0 @@ "util", |
@@ -1,2 +0,1 @@ | ||
const mkdirp = require("mkdirp"); | ||
const fs = require("fs"); | ||
@@ -10,6 +9,14 @@ const glob = require('glob'); | ||
this.depth = depth; | ||
this.warn = true; | ||
this.dry = false; | ||
this.silent = false; | ||
} | ||
setSilent(){ | ||
this.silent = true; | ||
} | ||
isSilent(){ | ||
return this.silent; | ||
} | ||
setDry(){ | ||
@@ -64,11 +71,11 @@ this.dry = true; | ||
log(string) { | ||
if (this.verbose) console.log(string); | ||
if ((this.debug || this.verbose) && !this.silent) console.log(string); | ||
} | ||
debugLog(string) { | ||
if (this.debug) console.log(string); | ||
if (this.debug && !this.silent) console.log(string); | ||
} | ||
warnLog(string) { | ||
if (this.warn) console.log(`*WARNING* ${string}`); | ||
if (!this.silent) console.log(`*WARNING* ${string}`); | ||
} | ||
@@ -96,3 +103,3 @@ | ||
this.log(`Package ${this.package.name}`); | ||
this.log(`Traversing package ${this.package.name}`); | ||
this.options = {...AbstractAssets.defaults, ...this.package.assets}; | ||
@@ -103,3 +110,6 @@ this.options.up = this.options.up + (this.depth * 2); | ||
if (typeof this.options.src === "string") { | ||
this.debugLog("options.src === string"); | ||
this.options.src = [this.options.src]; | ||
} else { | ||
this.debugLog("options.src !== string"); | ||
} | ||
@@ -106,0 +116,0 @@ |
@@ -9,9 +9,20 @@ #!/usr/bin/env node | ||
const argv = yargs | ||
.usage("$0 [options]") | ||
.boolean("s") | ||
.boolean("v") | ||
.boolean("d") | ||
.boolean("dry") | ||
.boolean("local") | ||
.boolean("dependencies") | ||
.boolean("r") | ||
.default("s", false) | ||
.default("v", false) | ||
.default("d", false) | ||
.default("dry", false) | ||
.default("local", true) | ||
.default("dependencies", true) | ||
.default("r", true) | ||
.default("fileset", "src") | ||
.describe("dry", "do not perform task, only console output") | ||
.describe("clean", "remove source files from destination, instead of copy") | ||
.describe("r", "set to false to not recurse over modules") | ||
.describe("s", "selent, do not print out to console") | ||
.describe("v", "verbose, print out more information") | ||
.describe("d", "debug, print out even more information") | ||
.argv; | ||
@@ -21,5 +32,8 @@ | ||
if (!argv.s) console.log("Asset Assistant : v0.0.3"); | ||
if (argv.clean) task = new CleanAssets(); | ||
else task = new LoadAssets(); | ||
if (argv.s) task.setSilent(); | ||
if (argv.v) task.setVerbose(); | ||
@@ -26,0 +40,0 @@ if (argv.d) task.setDebug(); |
@@ -25,2 +25,3 @@ const AbstractAssets = require("./AbstractAssets"); | ||
if (!this.isDry()){ | ||
this.log(`Creating directory ${copyObj.dest}`) | ||
mkdirp.sync(copyObj.dest); | ||
@@ -27,0 +28,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
22332
416
0