File tree Expand file tree Collapse file tree
magento2/usr/local/share/magento2
php-apache/usr/local/share/php
php-nginx/usr/local/share/php
symfony/usr/local/share/symfony
ubuntu/16.04/usr/local/share Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,10 +23,7 @@ source "$DIR/replace_core_config_values.sh"
2323bash " $DIR /../install_magento.sh" ;
2424
2525set -x
26- set +e
27- IS_HEM=" $( is_hem_project) "
28- set -e
29- if [ " $IS_HEM " == ' true' ]; then
26+ if is_hem_project; then
3027 # Run HEM
3128 export HEM_RUN_ENV=" ${HEM_RUN_ENV:- local} "
3229 for asset_env in $ASSET_DOWNLOAD_ENVIRONMENTS ; do
Original file line number Diff line number Diff line change 1010cd /app || exit 1
1111
1212if [ -f " $ASSET_ARCHIVE_PATH " ]; then
13- set +e
14- IS_CHOWN_FORBIDDEN=" $( is_chown_forbidden) "
15- set -e
13+ IS_CHOWN_FORBIDDEN=" $( run_return_boolean is_chown_forbidden) "
1614
1715 if [ " $IS_CHOWN_FORBIDDEN " != ' true' ]; then
1816 chown -R " ${CODE_OWNER} :${CODE_GROUP} " pub/media
Original file line number Diff line number Diff line change 1616
1717cd /app || exit 1;
1818
19- set +e
20- IS_CHOWN_FORBIDDEN=" $( is_chown_forbidden) "
21- set -e
19+ IS_CHOWN_FORBIDDEN=" $( run_return_boolean is_chown_forbidden) "
2220
2321if [ ! -d " vendor" ] || [ ! -f " vendor/autoload.php" ]; then
2422 as_code_owner " composer config repositories.magento composer https://repo.magento.com/"
Original file line number Diff line number Diff line change 1515cd /app || exit 1
1616
1717set +e
18- IS_CHOWN_FORBIDDEN=" $( is_chown_forbidden) "
18+ IS_CHOWN_FORBIDDEN=" $( run_return_boolean is_chown_forbidden) "
1919set -e
2020
2121if [ " $IS_CHOWN_FORBIDDEN " != ' true' ]; then
5757# (sad that we have to do that tho...)
5858
5959# Download the static assets
60- set +e
61- IS_HEM=" $( is_hem_project) "
62- set -e
63- if [ " $IS_HEM " == ' true' ]; then
60+ if is_hem_project; then
6461 export HEM_RUN_ENV=" ${HEM_RUN_ENV:- local} "
6562 for asset_env in $ASSET_DOWNLOAD_ENVIRONMENTS ; do
6663 as_build " hem --non-interactive --skip-host-checks assets download -e $asset_env "
Original file line number Diff line number Diff line change @@ -28,11 +28,11 @@ do_composer_postinstall_scripts() {
2828 as_code_owner ' composer run-script post-install-cmd'
2929}
3030
31- has_composer_package () (
32- set -e
31+ has_composer_package () {
3332 if [ ! -f " composer.lock" ]; then
3433 return
3534 fi
3635
3736 is_true " $( jq -c ' (.packages + .["packages-dev"])[] | select(.name == "' " $1 " ' ") | has("name")' composer.lock) "
38- )
37+ return " $? "
38+ }
Original file line number Diff line number Diff line change @@ -28,11 +28,11 @@ do_composer_postinstall_scripts() {
2828 as_code_owner ' composer run-script post-install-cmd'
2929}
3030
31- has_composer_package () (
32- set -e
31+ has_composer_package () {
3332 if [ ! -f " composer.lock" ]; then
3433 return
3534 fi
3635
3736 is_true " $( jq -c ' (.packages + .["packages-dev"])[] | select(.name == "' " $1 " ' ") | has("name")' composer.lock) "
38- )
37+ return " $? "
38+ }
Original file line number Diff line number Diff line change @@ -56,14 +56,17 @@ symfony_doctrine_mode() {
5656
5757uses_symfony_doctrine () {
5858 [ " $( symfony_doctrine_mode) " != " off" ]
59+ return " $? "
5960}
6061
6162uses_symfony_doctrine_mode_schema () {
6263 [ " $( symfony_doctrine_mode) " = " schema" ]
64+ return " $? "
6365}
6466
6567uses_symfony_doctrine_mode_migrations () {
6668 [ " $( symfony_doctrine_mode) " = " migrations" ]
69+ return " $? "
6770}
6871
6972do_database_rebuild () {
Original file line number Diff line number Diff line change @@ -80,6 +80,14 @@ convert_exit_code_to_string() {
8080 fi
8181}
8282
83+ run_return_boolean () {
84+ if " $@ " ; then
85+ echo ' true'
86+ else
87+ echo ' false'
88+ fi
89+ }
90+
8391convert_to_boolean_string () {
8492 if [ " $1 " == ' 1' ] || [ " $1 " == " true" ]; then
8593 echo ' true' ;
@@ -117,30 +125,24 @@ is_false() {
117125}
118126
119127is_hem_project () {
120- local RESULT=1
121- if [ -f /app/tools/hem/config.yaml ] || [ -f /app/tools/hobo/config.yaml ]; then
122- RESULT=0
123- fi
124- convert_exit_code_to_string " $RESULT "
128+ [ -f /app/tools/hem/config.yaml ] || [ -f /app/tools/hobo/config.yaml ]
129+ return " $? "
125130}
126131
127132is_app_mountpoint () {
128133 grep -q -E " /app (nfs|vboxsf|fuse\\ .osxfs)" /proc/mounts
129- local RESULT=" $? "
130- convert_exit_code_to_string " $RESULT "
134+ return " $? "
131135}
132136
133137is_chown_forbidden () {
134138 # Determine if the app directory is an NFS mountpoint, which doesn't allow chowning.
135139 grep -q -E " /app (nfs|vboxsf)" /proc/mounts
136- local RESULT=" $? "
137- convert_exit_code_to_string " $RESULT "
140+ return " $? "
138141}
139142
140143is_vboxsf_mountpoint () {
141144 grep -q " /app vboxsf" /proc/mounts
142- local RESULT=" $? "
143- convert_exit_code_to_string " $RESULT "
145+ return " $? "
144146}
145147
146148alias_function () {
Original file line number Diff line number Diff line change @@ -8,16 +8,14 @@ START_CRON=${START_CRON:-false}
88START_CRON=" $( convert_to_boolean_string " $START_CRON " ) "
99export START_CRON
1010
11- set +e
12- IS_CHOWN_FORBIDDEN=" $( is_chown_forbidden) "
11+ IS_CHOWN_FORBIDDEN=" $( run_return_boolean is_chown_forbidden) "
1312export IS_CHOWN_FORBIDDEN
1413
15- IS_VBOXSF_MOUNTPOINT=" $( is_vboxsf_mountpoint) "
14+ IS_VBOXSF_MOUNTPOINT=" $( run_return_boolean is_vboxsf_mountpoint) "
1615export IS_VBOXSF_MOUNTPOINT
1716
18- IS_APP_MOUNTPOINT=" $( is_app_mountpoint) "
17+ IS_APP_MOUNTPOINT=" $( run_return_boolean is_app_mountpoint) "
1918export IS_APP_MOUNTPOINT
20- set -e
2119
2220DEVELOPMENT_MODE=" $( convert_to_boolean_string_zero_is_true " ${DEVELOPMENT_MODE:- ${IS_APP_MOUNTPOINT} } " ) "
2321export DEVELOPMENT_MODE
You can’t perform that action at this time.
0 commit comments