-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathjustfile
111 lines (80 loc) · 2.59 KB
/
justfile
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
set export
help:
just -l
format target:
@echo 'Formatting {{target}}…'
just "format_{{target}}"
format_all:
#!/usr/bin/env bash
set -eo pipefail
node_modules/.bin/prettier -w ${FILES:-.}
format_php:
#!/usr/bin/env bash
set -eo pipefail
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php ${FILES:-app/ tests/ tools/ vhs/}
install_composer:
#!/usr/bin/env bash
set -euo pipefail
if [ ! -f ./tools/composer.phar ]; then
TMPFILE=$(mktemp)
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
php -r "copy('https://getcomposer.org/installer', '${TMPFILE}');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', '${TMPFILE}');")"
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then
echo >&2 'ERROR: Invalid installer checksum'
rm "${TMPFILE}"
exit 1
fi
php "${TMPFILE}" --install-dir ./tools --quiet
rm "${TMPFILE}"
else
echo "composer has already been set up!"
fi
./tools/composer.sh install
install_angular_ui_bootstrap:
#!/usr/bin/env bash
set -euo pipefail
mkdir -p web/components/custom/angular-ui/ \
&& cd web/components/custom/angular-ui/ \
&& wget https://raw.githubusercontent.com/angular-ui/bootstrap/refs/heads/gh-pages/ui-bootstrap-tpls-0.12.0.js \
&& wget https://raw.githubusercontent.com/angular-ui/bootstrap/refs/heads/gh-pages/ui-bootstrap-tpls-0.12.0.min.js
install_webcomponents: install_angular_ui_bootstrap
make_webcomponents_directories:
mkdir -p web/components/bower
mkdir -p web/components/custom
run_bower:
echo "Running bower"
./tools/bower.sh install
run_composer:
echo "Running composer"
./tools/composer.sh install
setup target:
@echo 'Setting up {{target}}…'
just "setup_{{target}}"
setup_webcomponents: make_webcomponents_directories install_webcomponents run_bower
setup_husky:
#!/usr/bin/env bash
set -euo pipefail
if [ ! -d .husky/_/ ]; then
node_modules/.bin/husky
else
echo "husky has already been set up!"
fi
setup_vendor: install_composer run_composer
setup_webhooker:
#!/usr/bin/env bash
set -euo pipefail
cd webhooker/ && npm install
test target:
@echo 'Testing {{target}}…'
just "test_{{target}}"
test_php:
#!/usr/bin/env bash
set -eo pipefail
vendor/bin/phpunit ${FILES:-app/ tests/ tools/ vhs/}
test_webhooker:
#!/usr/bin/env bash
set -eo pipefail
if [ "${FILES}" != "" ] ; then
cd webhooker && npm run test
fi