Skip to content

Commit e07137b

Browse files
authored
QoL: Adjust folder name to include support package type (#22)
Fixes #21
1 parent 3631eda commit e07137b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

main.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const cfRuntimeTypes = {
1414

1515
const timestamp = new Date().getTime();
1616
const dirPath = `./codefresh-support-${timestamp}`;
17-
const supportPackageZip = `./codefresh-support-package-${timestamp}.tar.gz`;
1817
const numOfProcesses = 5;
1918

2019
// ##############################
@@ -360,7 +359,7 @@ async function gatherPipelinesRuntime(cfConfig) {
360359
await Deno.writeTextFile(`${dirPath}/testPipelineBuildId.txt`, pipelineExecutionOutput.buildID);
361360
}
362361

363-
await prepareAndCleanup();
362+
await prepareAndCleanup('pipelines');
364363
} catch (error) {
365364
throw new Error('Error gathering Pipelines Runtime data:', error);
366365
}
@@ -375,7 +374,7 @@ async function gatherGitopsRuntime() {
375374
console.log(`\nGathering data in "${namespace}" namespace for the GitOps Runtime.`);
376375
await fetchAndSaveData(namespace);
377376
console.log('\nData Gathered Successfully.');
378-
await prepareAndCleanup();
377+
await prepareAndCleanup('gitops');
379378
} catch (error) {
380379
throw new Error(`Error gathering GitOps runtime data:`, error);
381380
}
@@ -441,7 +440,7 @@ async function gatherOnPrem(cfConfig) {
441440
]);
442441

443442
console.log('\nData Gathered Successfully.');
444-
await prepareAndCleanup();
443+
await prepareAndCleanup('onprem');
445444
} catch (error) {
446445
throw new Error(`Error gathering On-Prem data: ${error.message}`);
447446
}
@@ -471,7 +470,8 @@ async function writeGetApiCalls(resources, k8sType) {
471470
}));
472471
}
473472

474-
async function prepareAndCleanup() {
473+
async function prepareAndCleanup(selectedRuntime) {
474+
const supportPackageZip = `./cf-support-${selectedRuntime}-${timestamp}.tar.gz`;
475475
console.log(`Saving data to ${supportPackageZip}`);
476476
await tgz.compress(dirPath, supportPackageZip);
477477

0 commit comments

Comments
 (0)