diff --git a/code/code/argvars.go b/code/code/argvars.go index fdb38e13..e590fa9f 100644 --- a/code/code/argvars.go +++ b/code/code/argvars.go @@ -8,9 +8,9 @@ import ( "bytes" "fmt" "path/filepath" + "runtime" "strings" - "cogentcore.org/core/goosi" "cogentcore.org/core/texteditor" ) @@ -213,10 +213,8 @@ func (avp *ArgVarVals) Bind(arg string) string { bs = bytes.Replace(bs, []byte("\\{"), []byte("{"), -1) } - if goosi.TheApp != nil { - if goosi.TheApp.Platform() == goosi.Windows { - bs = bytes.Replace(bs, []byte("}/{"), []byte("}\\{"), -1) - } + if runtime.GOOS == "windows" { + bs = bytes.ReplaceAll(bs, []byte("/"), []byte("\\")) } return string(bs) } diff --git a/code/code/argvars_test.go b/code/code/argvars_test.go index 6e570344..cd096e91 100644 --- a/code/code/argvars_test.go +++ b/code/code/argvars_test.go @@ -57,7 +57,7 @@ func TestBind(t *testing.T) { } bv = avp.Bind("{FileDir}/{Filename}") - cv = "code/argvars_test.go" + cv = filepath.Join("code", "argvars_test.go") if bv != cv { t.Errorf("bind error: should have been: %v was: %v\n", cv, bv) }