SDA-1942: skip setting expiry if value is 0 (#966)

Signed-off-by: Vishwas Shashidhar <vishwas.shashidhar@symphony.com>
This commit is contained in:
Vishwas Shashidhar 2020-04-06 16:42:39 +05:30 committed by GitHub
parent 44428bd52c
commit 45f3a2f33e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,6 +53,12 @@ gulp.task('copy', function () {
gulp.task('setExpiry', function (done) {
// Set expiry of 15 days for test builds we create from CI
const expiryDays = process.argv[4] || 15;
if (expiryDays < 1) {
console.log(`Not setting expiry as the value provided is ${expiryDays}`);
done();
return;
}
console.log(`Setting expiry to ${expiryDays} days`);
const milliseconds = 24*60*60*1000;
const expiryTime = new Date().getTime() + (expiryDays * milliseconds);