Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Exclude target from pack #642

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading