-
Notifications
You must be signed in to change notification settings - Fork 17
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
How can I add timestamp to my zipped file name #26
Comments
If you're only using bash, then backticks and the date command might work: {
"scripts": "bestzip `date`.zip build/"
} (Backticks execute the command and then replace it with it's output in bash.) Alternatively, you can write your own script using the programmatic api and do something like |
Isn't easy to make a new feature for this tool to add the date on file? I'm running on Windows, but my builds machines are unix and windows. Will be way easier if the tool do this by itself. Please, consider this idea. |
I don't think that feature makes sense in the library - there's too many potential output formats for one thing. But you can write a very simple script that does exactly what you need. Something like this should work on windows and unix: #!/usr/bin/env node
var zip = require('bestzip');
var dest = new Date()).toString() + '.zip' ;
zip({
source: 'build/*',
destination: dest,
}).then(() => {
console.log(`saved to ${dest}`)
}); |
To be honest, the only output acceptable as default (or for a first interaction) is to use ISO 8601. But works with that script, thanks! |
I use this library as one of my npm scripts. Any suggestions on how I can add timestamp to the zipped file.
The text was updated successfully, but these errors were encountered: