Default to self-hosted unless GitHub hosted runner is detected

Refactor read_env in unix.sh
This commit is contained in:
Shivam Mathur 2022-01-12 21:15:11 +05:30
parent f7f679181d
commit 3a4acaaed8
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
2 changed files with 5 additions and 6 deletions

View File

@ -32,11 +32,10 @@ add_log() {
# Function to read env inputs.
read_env() {
[[ -z "${update}" ]] && update='false' && UPDATE='false' || update="${update}"
[ "$update" = false ] && [[ -n ${UPDATE} ]] && update="${UPDATE}"
[[ -z "${runner}" ]] && runner='github' && RUNNER='github' || runner="${runner}"
[ "$runner" = false ] && [[ -n ${RUNNER} ]] && runner="${RUNNER}"
[[ -z "${fail_fast}" ]] && fail_fast='false' || fail_fast="${fail_fast}"
update="${update:-${UPDATE:-false}}"
fail_fast="${fail_fast:-${FAIL_FAST:-false}}"
[[ -z "${ImageOS}" && -z "${ImageVersion}" ]] && _runner=self-hosted || _runner=github
runner="${runner:-${RUNNER:-$_runner}}"
}
# Function to download a file using cURL.

View File

@ -169,7 +169,7 @@ $ts = $env:PHPTS -eq 'ts'
if($env:PHPTS -ne 'ts') {
$env:PHPTS = 'nts'
}
if($env:RUNNER -eq 'self-hosted') {
if($env:RUNNER -eq 'self-hosted' -or (-not($env:ImageOS) -and -not($env:ImageVersion))) {
$bin_dir = 'C:\tools\bin'
$php_dir = "$php_dir$version"
$ext_dir = "$php_dir\ext"