Skip to content

Commit 6e45daf

Browse files
committed
plugin: If a resource bundle is present, pass the path to containertool
Alternatively: check the target input file list for resource files.
1 parent f067ebd commit 6e45daf

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Plugins/ContainerImageBuilder/main.swift

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,18 @@ extension PluginError: CustomStringConvertible {
8989

9090
for built in builtExecutables { Diagnostics.remark("Built product: \(built.url.path)") }
9191

92+
let resources = builtExecutables[0].url
93+
.deletingLastPathComponent()
94+
.appendingPathComponent(
95+
"\(context.package.displayName)_\(productName).resources"
96+
)
97+
9298
// Run a command line helper to upload the image
93-
let helper = try context.tool(named: "containertool")
94-
let helperURL = helper.url
95-
let helperArgs = extractor.remainingArguments + builtExecutables.map { $0.url.path }
99+
let helperURL = try context.tool(named: "containertool").url
100+
let helperArgs =
101+
(FileManager.default.fileExists(atPath: resources.path) ? ["--resources", resources.path] : [])
102+
+ extractor.remainingArguments
103+
+ builtExecutables.map { $0.url.path }
96104
let helperEnv = ProcessInfo.processInfo.environment.filter { $0.key.starts(with: "CONTAINERTOOL_") }
97105

98106
let err = Pipe()

0 commit comments

Comments
 (0)