-
-
Notifications
You must be signed in to change notification settings - Fork 75
/
build
executable file
·26 lines (23 loc) · 922 Bytes
/
build
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
#!/bin/sh
rm -f dist/m4b-tool* bin/*.log
if [ "$1" = "--with-plugins" ]; then
echo "!!! WITH PLUGINS !!!";
PHP_CODE="echo '';"
else
PHP_CODE="try {\
\$p = 'phar://'.realpath(__DIR__.'/dist/m4b-tool.phar').'/src/library/Command/Plugins/'; \
\$f = new Phar(\$p);\
foreach(\$f as \$file) {\
unlink(\$file);\
}\
} catch(Throwable \$e) {}";
fi
[ -e ".composer-alias" ] && COMPOSER_ALIAS=$(xargs < .composer-alias)
[ "$COMPOSER_ALIAS" != "" ] && COMPOSER="$COMPOSER_ALIAS" || COMPOSER="$(which composer)"
if [ "$COMPOSER" = "" ]; then
echo "composer required, but not installed"
exit 1;
fi
$COMPOSER install --no-dev --ignore-platform-reqs
php -d phar.readonly=off tools/box.phar build && php -d phar.readonly=off -r "${PHP_CODE}" && chmod +x dist/*.phar && tar -C dist -czf dist/m4b-tool.tar.gz m4b-tool.phar && cd dist && zip m4b-tool.zip m4b-tool.phar && cd -
$COMPOSER install