Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-contrib-compress

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-contrib-compress - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

31

grunt.js

@@ -61,2 +61,3 @@ /*

},
zip_flatten: {

@@ -72,2 +73,12 @@ options: {

zip_rootdir: {
options: {
mode: 'zip',
rootDir: 'abc123'
},
files: {
'tmp/compress_test_rootdir.zip': ['test/fixtures/**']
}
},
tar: {

@@ -94,2 +105,12 @@ options: {

tar_rootdir: {
options: {
mode: 'tar',
rootDir: 'abc123'
},
files: {
'tmp/compress_test_rootdir.tar': ['test/fixtures/**']
}
},
tgz: {

@@ -116,2 +137,12 @@ options: {

tgz_rootdir: {
options: {
mode: 'tgz',
rootDir: 'abc123'
},
files: {
'tmp/compress_test_rootdir.tgz': ['test/fixtures/**']
}
},
gzip: {

@@ -118,0 +149,0 @@ options: {

10

package.json
{
"name": "grunt-contrib-compress",
"description": "Compress files and folders.",
"version": "0.2.0",
"version": "0.2.1",
"homepage": "https://github.com/gruntjs/grunt-contrib-compress",

@@ -35,7 +35,7 @@ "author": {

"rimraf": "~2.0.2",
"grunt-contrib-lib": "~0.1.0",
"grunt-contrib-clean": "~0.1.0"
"grunt-contrib-lib": "~0.2.0"
},
"devDependencies": {
"grunt": "~0.3.15"
"grunt": "~0.3.15",
"grunt-contrib-clean": "~0.2.0"
},

@@ -45,2 +45,2 @@ "keywords": [

]
}
}

@@ -52,2 +52,6 @@ # grunt-contrib-compress

##### rootDir ```string```
This option allows the creation of a root folder to contain files within the resulting archive file.
#### Config Example

@@ -54,0 +58,0 @@

@@ -25,2 +25,3 @@ /*

var async = grunt.util.async;
var kindOf = grunt.util.kindOf;
var helpers = require('grunt-contrib-lib').init(grunt);

@@ -33,3 +34,4 @@

flatten: false,
level: 1
level: 1,
rootDir: false
});

@@ -48,7 +50,15 @@

if (options.basePath) {
if (options.basePath && kindOf(options.basePath) === 'string') {
options.basePath = path.normalize(options.basePath);
options.basePath = _(options.basePath).trim(path.sep);
} else {
options.basePath = false;
}
if (options.rootDir && kindOf(options.rootDir) === 'string') {
options.rootDir = path.normalize(options.rootDir).split(path.sep)[0];
} else {
options.rootDir = false;
}
grunt.verbose.writeflags(options, 'Options');

@@ -121,2 +131,3 @@

var basePath = options.basePath || findBasePath(srcFiles);
var rootDir = options.rootDir;

@@ -134,2 +145,6 @@ srcFiles.forEach(function(srcFile) {

if (rootDir && rootDir.length > 1) {
relative = path.join(options.rootDir, relative);
}
// make paths outside grunts working dir relative

@@ -199,4 +214,11 @@ relative = relative.replace(/\.\.(\/|\\)/g, '');

var tempDir = path.join(destDir, 'tar_' + (new Date()).getTime());
var tarDir = _(destFile).strLeftBack(destFileExt);
var tarDir;
if (options.rootDir && options.rootDir.length > 1) {
tarDir = options.rootDir;
options.rootDir = false;
} else {
tarDir = _(destFile).strLeftBack(destFileExt);
}
var tarProcess;

@@ -203,0 +225,0 @@

@@ -21,3 +21,3 @@ var grunt = require('grunt');

test.expect(4);
test.expect(5);

@@ -40,4 +40,9 @@ expect = 310;

expect = 1046;
result = getSize('compress_test_rootdir.zip');
test.equal(expect, result, 'should compress folders and their files into zip (with a root dir)');
test.done();
},
tar: function(test) {

@@ -48,3 +53,3 @@ 'use strict';

test.expect(4);
test.expect(5);

@@ -67,4 +72,9 @@ expect = 3072;

expect = 8192;
result = getSize('compress_test_rootdir.tar');
test.equal(expect, result, 'should compress folders and their files into tar (with a custom root dir)');
test.done();
},
tgz: function(test) {

@@ -75,3 +85,3 @@ 'use strict';

test.expect(4);
test.expect(5);

@@ -94,4 +104,9 @@ expect = true;

expect = true;
result = getSize('compress_test_rootdir.tgz') >= 200;
test.equal(expect, result, 'should compress folders and their files into tgz (with a custom root dir)');
test.done();
},
gzip: function(test) {

@@ -98,0 +113,0 @@ 'use strict';

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc