mirror of
https://github.com/deployphp/action.git
synced 2025-04-01 19:06:35 +00:00
feat: Support different php binary.
This commit is contained in:
parent
6242095e72
commit
84770a210d
2 changed files with 11 additions and 1 deletions
|
@ -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
|
||||||
|
|
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…
Add table
Reference in a new issue