use pwsh core

This commit is contained in:
Onyx and Iris 2025-02-07 11:39:07 +00:00
parent 8e37cec719
commit 7f84267b5a

View File

@ -4,7 +4,7 @@ dotenv: [ '.env' ]
vars: vars:
PROGRAM: vmrcli PROGRAM: vmrcli
SHELL: powershell SHELL: pwsh
CC: gcc CC: gcc
@ -32,13 +32,13 @@ tasks:
desc: "Link all files in obj/ for Windows" desc: "Link all files in obj/ for Windows"
deps: [compile] deps: [compile]
cmds: cmds:
- > - |
{{.SHELL}} -Command {{.SHELL}} -Command "
"if (!(Test-Path -Path '{{.BIN_DIR}}')) { if (!(Test-Path -Path '{{.BIN_DIR}}')) {
New-Item -ItemType Directory -Path '{{.BIN_DIR}}' New-Item -ItemType Directory -Path '{{.BIN_DIR}}'
}" }
- >
{{.SHELL}} -Command "{{.CC}} {{.LDFLAGS}} {{.OBJ_DIR}}/*.o {{.LDLIBS}} -o {{.BIN_DIR}}/{{.PROGRAM}}.exe" {{.CC}} {{.LDFLAGS}} {{.OBJ_DIR}}/*.o {{.LDLIBS}} -o {{.BIN_DIR}}/{{.PROGRAM}}.exe"
sources: sources:
- '{{.OBJ_DIR}}/**' - '{{.OBJ_DIR}}/**'
generates: generates:
@ -47,14 +47,13 @@ tasks:
compile: compile:
desc: "Compile all files in src/ and include/ for Windows" desc: "Compile all files in src/ and include/ for Windows"
cmds: cmds:
- > - |
{{.SHELL}} -Command {{.SHELL}} -Command "
"if (!(Test-Path -Path '{{.OBJ_DIR}}')) { if (!(Test-Path -Path '{{.OBJ_DIR}}')) {
New-Item -ItemType Directory -Path '{{.OBJ_DIR}}' New-Item -ItemType Directory -Path '{{.OBJ_DIR}}'
}" }
- >
{{.SHELL}} -Command Get-ChildItem -Path '{{.SRC_DIR}}' -Filter '*.c' |
"Get-ChildItem -Path '{{.SRC_DIR}}' -Filter '*.c' |
ForEach-Object { \$_.Name -replace '\.c$', '' } | ForEach-Object { \$_.Name -replace '\.c$', '' } |
ForEach-Object { {{.CC}} {{.CPPFLAGS}} {{.CFLAGS}} -c {{.SRC_DIR}}/\$_.c -o {{.OBJ_DIR}}/\$_.o }" ForEach-Object { {{.CC}} {{.CPPFLAGS}} {{.CFLAGS}} -c {{.SRC_DIR}}/\$_.c -o {{.OBJ_DIR}}/\$_.o }"
sources: sources:
@ -66,7 +65,7 @@ tasks:
clean: clean:
desc: "Remove all files in obj/ and bin/" desc: "Remove all files in obj/ and bin/"
cmds: cmds:
- > - |
{{.SHELL}} -Command "if (Test-Path -Path '{{.OBJ_DIR}}') { Remove-Item -Path '{{.OBJ_DIR}}' -Recurse -Force }" {{.SHELL}} -Command "
- > if (Test-Path -Path '{{.OBJ_DIR}}') { Remove-Item -Path '{{.OBJ_DIR}}' -Recurse -Force }
{{.SHELL}} -Command "if (Test-Path -Path '{{.BIN_DIR}}') { Remove-Item -Path '{{.BIN_DIR}}' -Recurse -Force }" if (Test-Path -Path '{{.BIN_DIR}}') { Remove-Item -Path '{{.BIN_DIR}}' -Recurse -Force }"