-
Notifications
You must be signed in to change notification settings - Fork 15
/
entrypoint.sh
executable file
·45 lines (33 loc) · 1.04 KB
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
set -e
pint_install_command=("composer global require laravel/pint:PINT_VERSION --no-progress --dev")
if [[ "${INPUT_PINTVERSION}" ]]
then
pint_install_command="${pint_install_command/PINT_VERSION/${INPUT_PINTVERSION}}"
elif [[ "${INPUT_USECOMPOSER}" ]]
then
pint_install_command="${pint_install_command/PINT_VERSION/$(composer show --locked | grep 'laravel/pint' | awk '{print $2}')}"
else
pint_install_command="${pint_install_command/:PINT_VERSION/}"
fi
pint_command=("pint")
if [[ "${INPUT_TESTMODE}" == true ]]; then
pint_command+=" --test"
fi
if [[ "${INPUT_VERBOSEMODE}" == true ]]; then
pint_command+=" -v"
fi
if [[ "${INPUT_CONFIGPATH}" ]]; then
pint_command+=" --config ${INPUT_CONFIGPATH}"
fi
if [[ "${INPUT_PRESET}" ]]; then
pint_command+=" --preset ${INPUT_PRESET}"
fi
if [[ "${INPUT_ONLYDIRTY}" == true ]]; then
pint_command+=" --dirty"
fi
echo "Running Command: " "${pint_install_command[@]}"
${pint_install_command[@]}
PATH="/tmp/vendor/bin:${PATH}"
echo "Running Command: " "${pint_command[@]}"
${pint_command[@]}