File tree Expand file tree Collapse file tree 4 files changed +19
-1
lines changed Expand file tree Collapse file tree 4 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 1+ ### 0.12.1 (2024-Feb-05)
2+
3+ * Fix https://github.com/kudulab/dojo/issues/37 - support the case when the current directory contains special characters
4+
15### 0.12.0 (2024-Feb-04)
26
37* Compile Dojo using Golang 1.21.6 thanks to using Docker image kudulab/golang-dojo:2.1.0
Original file line number Diff line number Diff line change 88 "log"
99 "math/rand"
1010 "os"
11+ "regexp"
1112 "runtime"
1213 "strconv"
1314 "strings"
@@ -113,6 +114,9 @@ func getRunIDGenerateFromCurrentDir(currentDirectory string) string {
113114 // the currentDirectory contains capital letters and docker-compose project names do not welcome
114115 // capital letters
115116 runID = strings .ToLower (runID )
117+ //runID = strings.ReplaceAll(runID, " ", "")
118+ // remove any special characters
119+ runID = regexp .MustCompile (`[^a-zA-Z0-9\-]+` ).ReplaceAllString (runID , "" )
116120 return runID
117121}
118122
Original file line number Diff line number Diff line change @@ -106,11 +106,21 @@ func Test_getRunID(t *testing.T) {
106106}
107107
108108func Test_getRunIDGenerateFromCurrentDir (t * testing.T ) {
109+ // lower case letters only
109110 runID := getRunIDGenerateFromCurrentDir ("mydir" )
110111 assert .True (t , strings .HasPrefix (runID , "dojo-mydir-" ))
111112
113+ // lower case and upper case letters
112114 runID = getRunIDGenerateFromCurrentDir ("mYdIR" )
113115 assert .True (t , strings .HasPrefix (runID , "dojo-mydir-" ))
116+
117+ // lower case and upper case letters and spaces
118+ runID = getRunIDGenerateFromCurrentDir ("mYdIR with spaces" )
119+ assert .True (t , strings .HasPrefix (runID , "dojo-mydirwithspaces-" ))
120+
121+ // lower case and upper case letters and spaces and special characters
122+ runID = getRunIDGenerateFromCurrentDir ("mYdIR wi#th s(3paces" )
123+ assert .True (t , strings .HasPrefix (runID , "dojo-mydirwiths3paces-" ))
114124}
115125
116126func getTestConfig () Config {
Original file line number Diff line number Diff line change 11package main
2- const DojoVersion = "0.12.0 "
2+ const DojoVersion = "0.12.1 "
33
You can’t perform that action at this time.
0 commit comments