Comparing version
{ | ||
"name": "larry", | ||
"description": "A packaging tool for bundling project releases", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
@@ -10,3 +10,3 @@ "dependencies": { | ||
"JSV": "~4.0.2", | ||
"adm-zip": "~0.4.4", | ||
"archiver": "~0.6.1", | ||
"wrench": "~1.5.7" | ||
@@ -13,0 +13,0 @@ }, |
@@ -140,2 +140,2 @@ # Larry # | ||
[drone-badge]: https://drone.io/bitbucket.org/fusioncharts/larry/status.png | ||
[drone-badge]: https://drone.io/github.com/fusioncharts/larry/status.png |
@@ -7,3 +7,3 @@ #!/usr/bin/env node | ||
wrench = require("wrench"), | ||
Zip = require("adm-zip"), | ||
Zip = require("archiver"), | ||
path = require("path"), | ||
@@ -77,6 +77,4 @@ projectPath =path.resolve(), | ||
else{ | ||
console.log("->Error: Invalid output path "+path.join(projectPath,self.config.options.output)); | ||
constructorCode = 3; | ||
this.constructorCode = constructorCode; | ||
return constructorCode; | ||
console.log("->Warning: Output path doesn't exist. Creating "+path.join(projectPath,self.config.options.output)); | ||
wrench.mkdirSyncRecursive(path.join(projectPath,self.config.options.output), 0777); | ||
} | ||
@@ -264,3 +262,9 @@ constructorCode = 0; | ||
destinationRoot, | ||
filterOptions = {}; | ||
filterOptions = {}, | ||
onArchive = function (output, packname) { | ||
return function () { | ||
console.log( "Deleting "+output, packname ); | ||
wrench.rmdirSyncRecursive(path.resolve(output, packname)); | ||
}; | ||
}; | ||
@@ -372,6 +376,11 @@ | ||
if(zipPackage){ | ||
var archive = new Zip(); | ||
archive.addLocalFolder(path.resolve(self.config.options.output,package.name)); | ||
archive.writeZip(path.resolve(self.config.options.output)+"/"+package.name+".zip"); | ||
wrench.rmdirSyncRecursive(path.resolve(self.config.options.output,package.name)); | ||
var archive = new Zip("zip"); | ||
var output = fs.createWriteStream(path.resolve(self.config.options.output)+"/"+package.name+".zip"); | ||
archive.on("end", onArchive(self.config.options.output, package.name)); | ||
archive.pipe(output); | ||
archive.bulk([ | ||
{ expand: true, cwd:path.resolve(self.config.options.output,package.name), src: ["**"]} | ||
]); | ||
archive.finalize(); | ||
console.log("->Success: Package created. Package zipped "+package.name); | ||
@@ -378,0 +387,0 @@ } |
@@ -44,3 +44,4 @@ { | ||
], | ||
"archiveRoot": "package1" | ||
"archiveRoot": "package1", | ||
"archive": true | ||
}, | ||
@@ -47,0 +48,0 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
35462
1.28%626
1.46%1
Infinity%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed