mirror of
https://github.com/deployphp/action.git
synced 2024-11-23 04:19:02 +00:00
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:
parent
6242095e72
commit
deec530661
@ -18,6 +18,10 @@
|
|||||||
# `deploy all`.
|
# `deploy all`.
|
||||||
# Required.
|
# Required.
|
||||||
dep: deploy
|
dep: deploy
|
||||||
|
|
||||||
|
# The path to the PHP binary to use.
|
||||||
|
# Optional.
|
||||||
|
php-binary: "php"
|
||||||
|
|
||||||
# Specifies a sub directory within the repository to deploy
|
# Specifies a sub directory within the repository to deploy
|
||||||
# Optional
|
# Optional
|
||||||
|
@ -7,6 +7,11 @@ inputs:
|
|||||||
dep:
|
dep:
|
||||||
required: true
|
required: true
|
||||||
description: The command.
|
description: The command.
|
||||||
|
|
||||||
|
php-binary:
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
description: Path to PHP binary.
|
||||||
|
|
||||||
sub-directory:
|
sub-directory:
|
||||||
required: false
|
required: false
|
||||||
|
8
index.js
8
index.js
@ -124,9 +124,15 @@ async function dep() {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Invalid JSON in options')
|
console.error('Invalid JSON in options')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let phpBin = 'php'
|
||||||
|
let phpBinArg = core.getInput('php-binary');
|
||||||
|
if (phpBinArg !== '') {
|
||||||
|
phpBin = phpBinArg
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await $`php ${dep} ${cmd} ${recipe} --no-interaction ${ansi} ${verbosity} ${options}`
|
await $`${phpBin} ${dep} ${cmd} ${recipe} --no-interaction ${ansi} ${verbosity} ${options}`
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
core.setFailed(`Failed: dep ${cmd}`)
|
core.setFailed(`Failed: dep ${cmd}`)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user