mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-26 13:23:05 +07:00
Default to self-hosted unless GitHub hosted runner is detected
Refactor read_env in unix.sh
This commit is contained in:
parent
f7f679181d
commit
3a4acaaed8
@ -32,11 +32,10 @@ add_log() {
|
|||||||
|
|
||||||
# Function to read env inputs.
|
# Function to read env inputs.
|
||||||
read_env() {
|
read_env() {
|
||||||
[[ -z "${update}" ]] && update='false' && UPDATE='false' || update="${update}"
|
update="${update:-${UPDATE:-false}}"
|
||||||
[ "$update" = false ] && [[ -n ${UPDATE} ]] && update="${UPDATE}"
|
fail_fast="${fail_fast:-${FAIL_FAST:-false}}"
|
||||||
[[ -z "${runner}" ]] && runner='github' && RUNNER='github' || runner="${runner}"
|
[[ -z "${ImageOS}" && -z "${ImageVersion}" ]] && _runner=self-hosted || _runner=github
|
||||||
[ "$runner" = false ] && [[ -n ${RUNNER} ]] && runner="${RUNNER}"
|
runner="${runner:-${RUNNER:-$_runner}}"
|
||||||
[[ -z "${fail_fast}" ]] && fail_fast='false' || fail_fast="${fail_fast}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to download a file using cURL.
|
# Function to download a file using cURL.
|
||||||
|
@ -169,7 +169,7 @@ $ts = $env:PHPTS -eq 'ts'
|
|||||||
if($env:PHPTS -ne 'ts') {
|
if($env:PHPTS -ne 'ts') {
|
||||||
$env:PHPTS = 'nts'
|
$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'
|
$bin_dir = 'C:\tools\bin'
|
||||||
$php_dir = "$php_dir$version"
|
$php_dir = "$php_dir$version"
|
||||||
$ext_dir = "$php_dir\ext"
|
$ext_dir = "$php_dir\ext"
|
||||||
|
Loading…
Reference in New Issue
Block a user