Skip to content

Commit

Permalink
Merge pull request #642 from smapiot/fix/pilet-pack-throws-when-targe…
Browse files Browse the repository at this point in the history
…t-exists-in-dist

fix: Exclude target from pack
  • Loading branch information
FlorianRappl authored Nov 13, 2023
2 parents f7cf44d + 6d2cc4d commit 1ecddf6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/tooling/piral-cli/src/common/pack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ export async function createPiletPackage(baseDir: string, source: string, target
log('generalDebug_0003', `Reading out unique files from "${content}" ...`);
const uniqueFiles = await getUniqueFiles(files);

// Edge case: If the files to be packaged contains the destination .tgz file, e.g., as a leftover
// from a previous build/pack, exclude that file, because it will be overwritten/replaced in the
// upcoming steps.
if (uniqueFiles.includes(file)) {
uniqueFiles.splice(uniqueFiles.indexOf(file), 1);
}

log('generalDebug_0003', `Creating directory if not exist for "${file}" ...`);
await createDirectory(dirname(file));

Expand Down

0 comments on commit 1ecddf6

Please sign in to comment.