Skip to content

Commit ce66a50

Browse files
BirmacherAkoskdobmayer
authored andcommitted
XCode: trim the project path. (#69)
* XCode: After the user drag and drop the project file to the console, it will trim the project path. characterSetToRemove {"\n", `'`, `"`} * common.go: - trimProjectpath method fix - Infinite loop removed. It will trim every ', ", character - contains method removed (Already have one as a util.) common_test.go: The "Multiple" test case has been removed. (Because we don't use multiple trim) xcode.go: clean https://trello.com/c/hgIG0VO9 e90afee commit fix * common.go: - trimProjectpath method fix - strings.Trim function's second parameter is a cutset -> There is no need for loop over the items in the cutset. https://trello.com/c/hgIG0VO9 4894265 commit fix * - cmd/common.go: trimProjectPath -> changed for inline code. - cmd/common_test.go: Test_trimProjectpath removed;
1 parent 39d2bfb commit ce66a50

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

cmd/common_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ import (
44
"testing"
55
"time"
66

7-
"github.com/stretchr/testify/require"
8-
97
"github.com/bitrise-tools/go-xcode/profileutil"
8+
"github.com/stretchr/testify/require"
109
)
1110

1211
func createTime(t *testing.T, timeStr string) time.Time {

cmd/xcode.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package cmd
33
import (
44
"fmt"
55
"path/filepath"
6+
"strings"
67

78
"github.com/bitrise-io/go-utils/colorstring"
89
"github.com/bitrise-io/go-utils/fileutil"
@@ -67,7 +68,8 @@ the one you usually open in Xcode, then hit Enter.
6768
if err != nil {
6869
return fmt.Errorf("failed to read input: %s", err)
6970
}
70-
projectPath = projpth
71+
72+
projectPath = strings.Trim(strings.TrimSpace(projpth), "'\"")
7173
}
7274
log.Debugf("projectPath: %s", projectPath)
7375
xcodeCmd.ProjectFilePath = projectPath

0 commit comments

Comments
 (0)