git-diff-archive
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -17,2 +17,4 @@ Usage: | ||
-h, --help Displays this help. | ||
-v, --verbose Show the append files and use git command. | ||
-n, --dry-run Don't actually create the files. just show what would be done. | ||
-f, --format (zip|tar) Specified in the `zip` or `tar` the format of the archive. | ||
@@ -37,2 +39,4 @@ -o, --output Output destination path of the archive. (Use `PATH_SYNTAX`) | ||
--verbose = false | ||
--dry-run = false | ||
--format = zip | ||
@@ -48,2 +52,4 @@ --prefix = {dirname} | ||
git_diff_archive HEAD~3 | ||
git_diff_archive HEAD~2 -v | ||
git_diff_archive HEAD~5 -n | ||
git_diff_archive HEAD HEAD~3 | ||
@@ -50,0 +56,0 @@ git_diff_archive 85d59ab |
24
index.js
@@ -19,3 +19,4 @@ "use strict"; | ||
output: "{dirname}-{datetime}.{format}", | ||
verbose: false | ||
verbose: false, | ||
dryRun: false | ||
}; | ||
@@ -71,10 +72,13 @@ | ||
spinner.start(); | ||
createArchive(files, output, params.format, prefix, params.verbose) | ||
createArchive(files, output, params.format, prefix, params.verbose, params.dryRun) | ||
.then((archive) => { | ||
spinner.stop(true); | ||
if (params.verbose) { | ||
console.log(""); | ||
console.log(colors.blue("[DONE]")); | ||
console.log(colors.blue(" command >>>"), cmd); | ||
console.log(colors.blue(" prefix >>>"), prefix); | ||
console.log(colors.blue(" files >>>"), files.join(", ")); | ||
console.log(`${colors.blue(" command:")} ${cmd}`); | ||
console.log(`${colors.blue(" prefix :")} ${prefix}`); | ||
console.log(`${colors.blue(" files :")}`); | ||
files.forEach(file => console.log(` ${file}`)); | ||
console.log(""); | ||
} | ||
@@ -124,4 +128,10 @@ resolve({ | ||
function createArchive(files, output, format, prefix, verbose) { | ||
function createArchive(files, output, format, prefix, verbose, dryRun) { | ||
return new Promise((resolve, reject) => { | ||
if (dryRun) { | ||
console.log(colors.blue("[DRY RUN]")); | ||
files.forEach(file => console.log(file)); | ||
return resolve({pointer: () => 0}); | ||
} | ||
const dir = path.dirname(output); | ||
@@ -139,3 +149,3 @@ mkdirp.sync(dir); | ||
if (verbose) { | ||
console.log(colors.blue("[INFO] >>> "), entry.name); | ||
console.log(`${colors.blue("Entried:")} ${entry.name}`); | ||
} | ||
@@ -142,0 +152,0 @@ }); |
{ | ||
"name": "git-diff-archive", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Archive of the diff files using node.js and git.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -52,2 +52,4 @@ git-diff-archive | ||
-h, --help Displays this help. | ||
-v, --verbose Show the append files and use git command. | ||
-n, --dry-run Don't actually create the files. just show what would be done. | ||
-f, --format (zip|tar) Specified in the `zip` or `tar` the format of the archive. | ||
@@ -72,2 +74,4 @@ -o, --output Output destination path of the archive. (Use `PATH_SYNTAX`) | ||
--verbose = false | ||
--dry-run = false | ||
--format = zip | ||
@@ -83,2 +87,4 @@ --prefix = {dirname} | ||
git_diff_archive HEAD~3 | ||
git_diff_archive HEAD~2 -v | ||
git_diff_archive HEAD~5 -n | ||
git_diff_archive HEAD HEAD~3 | ||
@@ -85,0 +91,0 @@ git_diff_archive 85d59ab |
Sorry, the diff of this file is not supported yet
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
16246
258
121