Skip to content

Commit

Permalink
Put .gitignore in enclosing directory
Browse files Browse the repository at this point in the history
  • Loading branch information
dfed committed Sep 2, 2024
1 parent 604599c commit bb390cd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Plugins/InstallSafeDITool/InstallCLIPluginCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ struct InstallSafeDITool: CommandPlugin {
print("could not extract version for SafeDI")
return
}
let expectedToolFolder = context.package.directoryURL.appending(
components: ".safedi",
String(version)
let safediFolder = context.package.directoryURL.appending(
component: ".safedi"
)
let expectedToolFolder = safediFolder.appending(
component: String(version)
)
let expectedToolLocation = expectedToolFolder.appending(component: "safeditool")

Expand Down Expand Up @@ -83,10 +85,10 @@ struct InstallSafeDITool: CommandPlugin {
at: downloadedURL,
to: expectedToolLocation
)
let gitIgnoreLocation = expectedToolFolder.appending(component: ".gitignore")
let gitIgnoreLocation = safediFolder.appending(component: ".gitignore")
if !FileManager.default.fileExists(atPath: gitIgnoreLocation.path()) {
try """
\(expectedToolLocation.lastPathComponent)
*/\(expectedToolLocation.lastPathComponent)
""".write(
to: gitIgnoreLocation,
atomically: true,
Expand Down

0 comments on commit bb390cd

Please sign in to comment.