Ensure path passed to codesigning is absolute when using mac-crafter codesign
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Thu, 21 Nov 2024 15:09:13 +0000 (23:09 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Thu, 21 Nov 2024 15:09:13 +0000 (23:09 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
admin/osx/mac-crafter/Sources/main.swift

index d7e680a30fe41eca91c2cf60337d9f8509b28290..654954ec965c0042d79340fbe6caf9b2d811345f 100644 (file)
@@ -275,7 +275,10 @@ struct Codesign: ParsableCommand {
     var codeSignIdentity: String
 
     mutating func run() throws {
-        try codesignClientAppBundle(at: appBundlePath, withCodeSignIdentity: codeSignIdentity)
+        let absolutePath = appBundlePath.hasPrefix("/")
+            ? appBundlePath
+            : "\(FileManager.default.currentDirectoryPath)/\(appBundlePath)"
+        try codesignClientAppBundle(at: absolutePath, withCodeSignIdentity: codeSignIdentity)
     }
 }