Skip to content

Commit 7322a36

Browse files
authored
[plugin] Fix #505 : resources are not included in the archive on Linux (#506)
Resources are not included in the archive on Linux #505 In addition, the script that checks if the resources are correctly included in an archive when building on Linux is not working. It failed to detected missing resources. This patch fix both the plugin and the CI script
1 parent c3380a0 commit 7322a36

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Diff for: .github/workflows/scripts/check-archive-plugin.sh

+7
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,14 @@ unzip -l "${ZIP_FILE}" | grep --silent bootstrap
4040

4141
# if EXAMPLE is ResourcesPackaging, check if the ZIP file contains hello.txt
4242
if [ "$EXAMPLE" == "ResourcesPackaging" ]; then
43+
echo "Checking if resource was added to the ZIP file"
4344
unzip -l "${ZIP_FILE}" | grep --silent hello.txt
45+
SUCCESS=$?
46+
if [ "$SUCCESS" -eq 1 ]; then
47+
log "❌ Resource not found." && exit 1
48+
else
49+
log "✅ Resource found."
50+
fi
4451
fi
4552

4653
echo "✅ The archive plugin is OK with example ${EXAMPLE}"

Diff for: Plugins/AWSLambdaPackager/Plugin.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,11 @@ struct AWSLambdaPackager: CommandPlugin {
250250
let relocatedResourcesDirectory = workingDirectory.appending(path: resourcesDirectoryName)
251251
if FileManager.default.fileExists(atPath: artifactURL.path()) {
252252
do {
253+
arguments.append(resourcesDirectoryName)
253254
try FileManager.default.copyItem(
254255
atPath: artifactURL.path(),
255256
toPath: relocatedResourcesDirectory.path()
256257
)
257-
arguments.append(resourcesDirectoryName)
258258
} catch let error as CocoaError {
259259

260260
// On Linux, when the build has been done with Docker,

0 commit comments

Comments
 (0)