Skip to content

Commit

Permalink
Add support for directories/files names with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
ptwoms authored and rockbruno committed Jun 8, 2021
1 parent 224259a commit dad3408
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ struct SchemeInfoProvider: SchemeInfoProviderProtocol {
if let swiftFileList = swiftFileList {
let swiftFilePaths = try swiftFileList.read()
.components(separatedBy: "\n")
.filter { !$0.isEmpty }
.filter { !$0.isEmpty }.map{ $0.removeEscapedSpaces }

if let complieFlagIndex = compilerArguments.firstIndex(of: "-c") {
var insertIndex = complieFlagIndex
Expand Down
4 changes: 4 additions & 0 deletions Sources/SwiftShieldCore/StringHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ extension String {
var replacingEscapedSpaces: String {
replacingOccurrences(of: "\\ ", with: spacedFolderPlaceholder)
}

var removeEscapedSpaces: String {
replacingOccurrences(of: "\\ ", with: " ")
}

var removingPlaceholder: String {
replacingOccurrences(of: spacedFolderPlaceholder, with: " ")
Expand Down

0 comments on commit dad3408

Please sign in to comment.