From 6a91c6c80011391fe3d5b5600638177c48bb134a Mon Sep 17 00:00:00 2001 From: Damien Whitten Date: Thu, 16 Jul 2015 08:47:35 +1000 Subject: [PATCH 1/3] Adds gid and uid option, pass through to archiver. --- tasks/lib/compress.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tasks/lib/compress.js b/tasks/lib/compress.js index 72d56d4..9ead19f 100644 --- a/tasks/lib/compress.js +++ b/tasks/lib/compress.js @@ -158,6 +158,13 @@ module.exports = function(grunt) { stats: fstat }; + if (file.gid != null){ + fileData.gid = file.gid + } + if (file.uid != null){ + fileData.uid = file.uid + } + for (var i = 0; i < dataWhitelist.length; i++) { if (typeof file[dataWhitelist[i]] === 'undefined') { continue; From 9f41757073b9f4d3570df41ab3dc5f2053035010 Mon Sep 17 00:00:00 2001 From: Damien Whitten Date: Thu, 16 Jul 2015 08:57:05 +1000 Subject: [PATCH 2/3] Updated documentation for gid and uid --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 575351d..b24175a 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,19 @@ If true, file contents will be archived without compression. Type: `String` Modes: `zip` +#### gid +Type: `Integer` +Modes: `tar` `tgz` + +Sets the group of the file in the archive + +#### uid +Type: `Integer` +Modes: `tar` `tgz` + +Sets the user of the file in the archive + + Sets the file comment. ### Usage Examples From 37e786cb07aeb3264e01fa454883c38c807cacd6 Mon Sep 17 00:00:00 2001 From: Damien Whitten Date: Thu, 16 Jul 2015 16:59:28 +1000 Subject: [PATCH 3/3] Use existing whitelist for gid and uid --- tasks/lib/compress.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/tasks/lib/compress.js b/tasks/lib/compress.js index 9ead19f..4adc9eb 100644 --- a/tasks/lib/compress.js +++ b/tasks/lib/compress.js @@ -98,7 +98,7 @@ module.exports = function(grunt) { var archive = archiver.create(mode, exports.options); var dest = exports.options.archive; - var dataWhitelist = ['comment', 'date', 'mode', 'store']; + var dataWhitelist = ['comment', 'date', 'mode', 'store', 'gid', 'uid']; var sourcePaths = {}; // Ensure dest folder exists @@ -158,13 +158,6 @@ module.exports = function(grunt) { stats: fstat }; - if (file.gid != null){ - fileData.gid = file.gid - } - if (file.uid != null){ - fileData.uid = file.uid - } - for (var i = 0; i < dataWhitelist.length; i++) { if (typeof file[dataWhitelist[i]] === 'undefined') { continue;