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

[plugin] Fix #505 : resources are not included in the archive on Linux #506

Merged
merged 4 commits into from
Mar 17, 2025
Merged
Show file tree
Hide file tree
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 .github/workflows/scripts/check-archive-plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ unzip -l "${ZIP_FILE}" | grep --silent bootstrap

# if EXAMPLE is ResourcesPackaging, check if the ZIP file contains hello.txt
if [ "$EXAMPLE" == "ResourcesPackaging" ]; then
echo "Checking if resource was added to the ZIP file"
unzip -l "${ZIP_FILE}" | grep --silent hello.txt
SUCCESS=$?
if [ "$SUCCESS" -eq 1 ]; then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know these two lines can be merged as one but I favored readability over concision

log "❌ Resource not found." && exit 1
else
log "✅ Resource found."
fi
fi

echo "✅ The archive plugin is OK with example ${EXAMPLE}"
Expand Down
2 changes: 1 addition & 1 deletion Plugins/AWSLambdaPackager/Plugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,11 @@ struct AWSLambdaPackager: CommandPlugin {
let relocatedResourcesDirectory = workingDirectory.appending(path: resourcesDirectoryName)
if FileManager.default.fileExists(atPath: artifactURL.path()) {
do {
arguments.append(resourcesDirectoryName)
try FileManager.default.copyItem(
atPath: artifactURL.path(),
toPath: relocatedResourcesDirectory.path()
)
arguments.append(resourcesDirectoryName)
} catch let error as CocoaError {

// On Linux, when the build has been done with Docker,
Expand Down
Loading