Skip to content

Added archive name option to lambda_package. #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
npm-debug.log
tmp
.idea
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ Default value: `dist`

The folder where the complete zip files should be saved relative to the Gruntfile.

##### options.archive_name
Type: `String`
Default value: `null`

The name of the output archive name (before time and/or version is added), if null package.json name property will be used.

#### Usage Examples

##### Default Options
Expand Down
8 changes: 6 additions & 2 deletions utils/package_task.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ packageTask.getHandler = function (grunt) {
'include_time': true,
'include_version': true,
'package_folder': './',
'include_files': []
'include_files': [],
'archive_name': null
});

var pkg = JSON.parse(fs.readFileSync(path.resolve(options.package_folder + '/package.json'), "utf8"));
Expand All @@ -43,7 +44,10 @@ packageTask.getHandler = function (grunt) {
time_string = dateFacade.getFormattedTimestamp(new Date());
}

var archive_name = pkg.name;
var archive_name = options.archive_name;
if(!archive_name) {
archive_name = pkg.name;
}

if (options.include_version) {
archive_name += '_' + pkg.version.replace(/\./g, '-');
Expand Down