Skip to content

Commit

Permalink
Fix Xcode project locking on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewchang-bird committed Jan 6, 2022
1 parent 8bcad37 commit 4aa6388
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ extension Build {
logInfo("Locking the example projects directory")
let exampleProjects = Path("./Examples")
let fileManager = FileManager()
let originalAttributes = try fileManager.attributesOfItem(atPath: exampleProjects.string)
try fileManager.setAttributes([.posixPermissions: FileManager.PosixPermissions.writeOnly],
ofItemAtPath: exampleProjects.string)
defer {
logInfo("Unlocking the example projects directory")
try? fileManager.setAttributes([.posixPermissions: FileManager.PosixPermissions.readWrite],
try? fileManager.setAttributes([.posixPermissions: originalAttributes[.posixPermissions]
?? FileManager.PosixPermissions.readWrite],
ofItemAtPath: exampleProjects.string)
}

Expand Down

0 comments on commit 4aa6388

Please sign in to comment.