I've been looking all over for a way to name a zip file with the current date, using the "grunt-contrib-press" plugin. Is there a way to acplish it? I properly installed it, and set as follow:
press: {
build: {
options: {
archive: './zipped/foo.zip',
mode: 'zip'
},
files: [
{ src: 'build/**'}
]
}
}
I would like to have a zipped file named as the current date, in place of the custom name "foo":
2014-09-25.zip
I've been looking all over for a way to name a zip file with the current date, using the "grunt-contrib-press" plugin. Is there a way to acplish it? I properly installed it, and set as follow:
press: {
build: {
options: {
archive: './zipped/foo.zip',
mode: 'zip'
},
files: [
{ src: 'build/**'}
]
}
}
I would like to have a zipped file named as the current date, in place of the custom name "foo":
2014-09-25.zip
Share
Improve this question
edited Sep 25, 2014 at 12:21
Giao Paita
asked Sep 25, 2014 at 8:50
Giao PaitaGiao Paita
1,4192 gold badges12 silver badges22 bronze badges
1 Answer
Reset to default 10You can try using grunt.template.today()
...
press: {
build: {
options: {
archive: './zipped/' + grunt.template.today('yyyy-mm-dd') + '.zip',
mode: 'zip'
},
files: [
{ src: 'build/**'}
]
}
}