Improve windows shell handling (#1309)

* Improve windows shell handling

* Add shell in command line

* Fix shellopts bug

* Add quote string

* Refactor `exportFiles` function

* Add defaults for Windows

* Revert "Add defaults for Windows"

Accidental commit

This reverts commit 5ff32650fe.

* Separate handling for CMD vs PowerShell

* Add case insensitive check
This commit is contained in:
Joe Lim authored and GitHub committed 2023-07-03 17:31:45 +03:00
1 parent 56ab5ccc61
commit 592e7fe4be
4 files changed
+35 -39

No files matched your search

+2 -13
View File
@@ -224,17 +224,6 @@ func errCrossDevice(err error) bool {
return err.(*os.LinkError).Err.(unix.Errno) == unix.EXDEV
}
func exportFiles(f string, fs []string, pwd string) {
envFile := f
envFiles := strings.Join(fs, gOpts.filesep)
os.Setenv("f", envFile)
os.Setenv("fs", envFiles)
os.Setenv("PWD", pwd)
if len(fs) == 0 {
os.Setenv("fx", envFile)
} else {
os.Setenv("fx", envFiles)
}
func quoteString(s string) string {
return s
}