Skip to content

Commit e655263

Browse files
authored
quickstart run-swoole-cli-builder.sh 优化 (#903)
* fix run-swoole-cli-buider-bug * quickstart run-swoole-cli-builder.sh 优化
1 parent 7c8725e commit e655263

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

sapi/quickstart/linux/run-swoole-cli-builder-container.sh

+14-1
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@ OPTIONS=''
1616
while [ $# -gt 0 ]; do
1717
case "$1" in
1818
--mirror)
19+
MIRROR="$2"
1920
case "$MIRROR" in
2021
china)
21-
MIRROR="$2"
2222
OPTIONS=" --mirror china "
2323
;;
24+
*)
25+
echo "$0 parameter error"
26+
exit 0
27+
;;
2428
esac
2529

2630
;;
@@ -32,6 +36,8 @@ bash setup-php-runtime.sh ${OPTIONS}
3236
export PATH=${__PROJECT__}/bin/runtime:$PATH
3337
alias php="php -d curl.cainfo=${__PROJECT__}/bin/runtime/cacert.pem -d openssl.cafile=${__PROJECT__}/bin/runtime/cacert.pem "
3438

39+
export COMPOSER_ALLOW_SUPERUSER=1
40+
3541
if [ "$MIRROR" = 'china' ]; then
3642
composer config -g repos.packagist composer https://mirrors.tencent.com/composer/
3743
fi
@@ -46,4 +52,11 @@ fi
4652
php ./prepare.php --skip-download=yes --without-docker=yes
4753

4854
bash make.sh docker-build ${MIRROR}
55+
56+
{
57+
docker exec -it swoole-cli-builder which bash
58+
} || {
59+
docker exec -it swoole-cli-builder sh /work/sapi/quickstart/linux/alpine-init.sh ${OPTIONS}
60+
}
61+
4962
bash make.sh docker-bash

0 commit comments

Comments
 (0)