Add GH Action for Testing on Windows (#132)

* Add windows specific test changes
* Change the command line parsing library - Possible breaking changes for windows users!
This commit is contained in:
Benson Wong
2025-05-14 21:51:53 -07:00
committed by GitHub
parent 5025c2f1f3
commit d7b390df74
11 changed files with 136 additions and 42 deletions

View File

@@ -4,11 +4,12 @@ import (
"fmt"
"io"
"os"
"runtime"
"sort"
"strconv"
"strings"
"github.com/google/shlex"
"github.com/billziss-gh/golib/shlex"
"gopkg.in/yaml.v3"
)
@@ -233,9 +234,11 @@ func SanitizeCommand(cmdStr string) ([]string, error) {
cmdStr = strings.ReplaceAll(cmdStr, "\\\n", " ")
// Split the command into arguments
args, err := shlex.Split(cmdStr)
if err != nil {
return nil, err
var args []string
if runtime.GOOS == "windows" {
args = shlex.Windows.Split(cmdStr)
} else {
args = shlex.Posix.Split(cmdStr)
}
// Ensure the command is not empty