Proposal to support a different php binary (#82)

* feat: Support different php binary.

* feat: Support different php binary.

---------

Co-authored-by: Nikolaj Stockholm <info@nikolajstockholm.dk>
This commit is contained in:
Nikolaj Stockholm 2024-05-07 12:46:52 +02:00 committed by GitHub
parent 6242095e72
commit deec530661
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 1 deletions

@ -19,6 +19,10 @@
# Required.
dep: deploy
# The path to the PHP binary to use.
# Optional.
php-binary: "php"
# Specifies a sub directory within the repository to deploy
# Optional
sub-directory: "..."

@ -8,6 +8,11 @@ inputs:
required: true
description: The command.
php-binary:
required: false
default: ''
description: Path to PHP binary.
sub-directory:
required: false
default: ''

@ -125,8 +125,14 @@ async function dep() {
console.error('Invalid JSON in options')
}
let phpBin = 'php'
let phpBinArg = core.getInput('php-binary');
if (phpBinArg !== '') {
phpBin = phpBinArg
}
try {
await $`php ${dep} ${cmd} ${recipe} --no-interaction ${ansi} ${verbosity} ${options}`
await $`${phpBin} ${dep} ${cmd} ${recipe} --no-interaction ${ansi} ${verbosity} ${options}`
} catch (err) {
core.setFailed(`Failed: dep ${cmd}`)
}