Skip to content
Snippets Groups Projects
Commit aff6f805 authored by Recolic K's avatar Recolic K
Browse files

add-cmd-envvar

parent 3366ba02
No related branches found
No related tags found
No related merge requests found
Pipeline #866 passed with stage
in 3 minutes and 32 seconds
image: golang
build:
script: tools/build-and-pack.sh
script: tools/build-and-pack.sh common-arch-only
artifacts:
paths:
- "*.tar.gz"
......
......@@ -13,7 +13,7 @@ steps:
inputs:
targetType: inline
script: >
tools/build-and-pack.sh
tools/build-and-pack.sh common-arch-only
for fname in ./*.tar.gz; do
curl -X PUT -u "recolic-manifact:$RECOLIC_MANIFACT_ACC_TOKEN" "https://drive.recolic.net/remote.php/dav/files/recolic-manifact/openxt-release/$fname" --data-binary @"$fname"
......
......@@ -3,7 +3,7 @@ package main
import "fmt"
// generateEnvvar generates key-value pairs, and this function converts key-value pairs into good env string.
// supports: bash, fish, powershell
// supports: bash, fish, powershell, cmd
// panic on error, because it seems to be unrecoverable.
func SerializeEnvvar(shellName string, asUniversalVar bool, kvPairs map[string]string) string {
result, fmtStr := "", ""
......@@ -26,8 +26,15 @@ func SerializeEnvvar(shellName string, asUniversalVar bool, kvPairs map[string]s
if asUniversalVar {
panic("serializeEnvvar.NotSupportedError: doesn't support powershell universal variable. ")
}
break
case "cmd":
fmtStr = "set \"%v=%v\""
if asUniversalVar {
panic("serializeEnvvar.NotSupportedError: doesn't support cmd universal variable. ")
}
break
default:
panic("serializeEnvvar.InvalidArgument: shellName should be bash,fish,powershell, instead of " + shellName)
panic("serializeEnvvar.InvalidArgument: shellName should be bash,fish,powershell,cmd, instead of " + shellName)
}
for k, v := range kvPairs {
......
......@@ -10,7 +10,7 @@ import (
// Some options here. Would be improved in beta release.
const DEDUCT_PKGNAME_FROM_VARNAME = true
const USE_PROJECT_NETVER_INSTEAD_OF_HINTPATH_NETVER = false
const OPENXT_VERSION = "1.4.1-2"
const OPENXT_VERSION = "1.4.1-3"
func print_help_and_exit() {
println("Usage: openxt <subcommand> [options...]")
......@@ -33,7 +33,7 @@ func main() {
nugetConfigPath := flag.String("nuget-config", "", "Path to nuget.config. It's ~/.nuget/NuGet/NuGet.Config by default. ")
localRepoDir := flag.String("local-repo-dir", "", "Path to local nuget repo. (known as CxCache in CoreXT)")
binDir := flag.String("bin-dir", "", "Path for output build. (TODO: remove in the future)")
shell := flag.String("shell", "bash", "Shell for the output env variables, supports bash/fish/powershell")
shell := flag.String("shell", "bash", "Shell for the output env variables, supports bash/fish/powershell/cmd")
if(len(os.Args) < 2) {
print_help_and_exit()
}
......
......@@ -31,13 +31,14 @@ build linux amd64
build linux 386
build linux arm
build linux arm64
build freebsd amd64
build openbsd amd64
build darwin amd64
build windows amd64
build windows arm
build windows 386
[[ "$1" = "common-arch-only" ]] && exit 0
build freebsd amd64
build openbsd amd64
build linux mips
build linux mips64
build linux mipsle
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment