Skip to content

Commit 0a8bc60

Browse files
committed
🎨 removed duplicate code
1 parent 86daff6 commit 0a8bc60

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

bin/helpers/timezone.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1711,4 +1711,4 @@
17111711
"Pacific/Wallis",
17121712
"UTC+12"
17131713
]
1714-
}
1714+
}

bin/helpers/utils.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -399,16 +399,13 @@ exports.isValidTimezone = (timezone) => {
399399

400400
exports.setTimezone = (bsConfig, args) => {
401401
let timezone = args.timezone || bsConfig.run_settings.timezone;
402-
let newTimezone;
403-
if(this.isNotUndefined(timezone) && this.isValidTimezone(timezone)){
404-
newTimezone = timezone;
405-
} else {
402+
if(this.isUndefined(timezone) && !this.isValidTimezone(timezone)){
406403
logger.error(`Invalid timezone = ${timezone}`);
407404
syncCliLogger.info(chalk.red(Constants.userMessages.INVALID_TIMEZONE));
408405
process.exit(1);
409406
}
410-
bsConfig.run_settings.timezone = newTimezone;
411-
logger.debug(`Setting timezone = ${newTimezone}`);
407+
bsConfig.run_settings.timezone = timezone;
408+
logger.debug(`Setting timezone = ${timezone}`);
412409
}
413410

414411
exports.setRecordFlag = (bsConfig, args) => {

0 commit comments

Comments
 (0)