Skip to content

Commit 6e214aa

Browse files
committed
Fix inconsistent deletion of temp/backup directories
1 parent 30ddcff commit 6e214aa

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.changeset/friendly-shoes-sneeze.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@bluecadet/launchpad-content": patch
3+
---
4+
5+
Fix inconsistent deletion of temp/backup directories

packages/content/lib/launchpad-content.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ export class LaunchpadContent {
7575
/** @type {Map<string, ContentTransform>} */
7676
_contentTransforms = new Map();
7777

78+
/** @type {Date} */
79+
_startDatetime = new Date();
80+
7881
/**
7982
* @param {import('./content-options.js').ContentOptions} [config]
8083
* @param {Logger} [parentLogger]
@@ -120,6 +123,8 @@ export class LaunchpadContent {
120123
return Promise.resolve();
121124
}
122125

126+
this._startDatetime = new Date();
127+
123128
try {
124129
this._logger.info(`Downloading ${chalk.cyan(sources.length)} sources`);
125130

@@ -501,7 +506,7 @@ export class LaunchpadContent {
501506
*/
502507
_getDetokenizedPath(tokenizedPath, downloadPath) {
503508
if (tokenizedPath.includes(TIMESTAMP_TOKEN)) {
504-
tokenizedPath = tokenizedPath.replace(TIMESTAMP_TOKEN, FileUtils.getDateString());
509+
tokenizedPath = tokenizedPath.replace(TIMESTAMP_TOKEN, FileUtils.getDateString(this._startDatetime));
505510
}
506511
if (tokenizedPath.includes(DOWNLOAD_PATH_TOKEN)) {
507512
tokenizedPath = tokenizedPath.replace(DOWNLOAD_PATH_TOKEN, downloadPath);

0 commit comments

Comments
 (0)