Skip to content

Commit 1463d37

Browse files
committed
fixed "binary operator expected" failures
1 parent d4c6f3b commit 1463d37

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

init_project.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if ! echo ${vagrant_plugin_list} | grep -q 'vagrant-host-shell' ; then
2424
fi
2525

2626
# Generate random IP address and host name to prevent collisions, if not specified explicitly in local config
27-
if [ ! -f "${vagrant_dir}/etc/config.yaml" ]; then
27+
if [[ ! -f "${vagrant_dir}/etc/config.yaml" ]]; then
2828
cp "${config_path}.dist" "${config_path}"
2929
fi
3030
random_ip=$(( ( RANDOM % 240 ) + 12 ))
@@ -46,18 +46,18 @@ while getopts 'fcp' flag; do
4646
*) error "Unexpected option ${flag}" ;;
4747
esac
4848
done
49-
if [ ${force_project_cleaning} -eq 1 ]; then
49+
if [[ ${force_project_cleaning} -eq 1 ]]; then
5050
vagrant destroy -f
51-
if [ ${force_codebase_cleaning} -eq 1 ]; then
5251
mv "${vagrant_dir}/etc/guest/.gitignore" "${vagrant_dir}/etc/.gitignore.back"
5352
rm -rf "${vagrant_dir}/.vagrant" "${vagrant_dir}/etc/guest"
5453
mkdir "${vagrant_dir}/etc/guest"
5554
mv "${vagrant_dir}/etc/.gitignore.back" "${vagrant_dir}/etc/guest/.gitignore"
55+
if [[ ${force_codebase_cleaning} -eq 1 ]]; then
5656
rm -rf "${magento_ce_dir}"
5757
fi
5858
fi
5959

60-
if [ ! -d ${magento_ce_dir} ]; then
60+
if [[ ! -d ${magento_ce_dir} ]]; then
6161
if [[ ${host_os} == "Windows" ]]; then
6262
git config --global core.autocrlf false
6363
git config --global core.eol LF
@@ -69,7 +69,7 @@ if [ ! -d ${magento_ce_dir} ]; then
6969
# Check out EE repository
7070
# By default EE repository is not specified and EE project is not checked out
7171
repository_url_ee=$(bash "${vagrant_dir}/scripts/get_config_value.sh" "repository_url_ee")
72-
if [ -n "${repository_url_ee}" ]; then
72+
if [[ -n "${repository_url_ee}" ]]; then
7373
git clone ${repository_url_ee} "${magento_ee_dir}"
7474
fi
7575
fi
@@ -84,10 +84,10 @@ vagrant up
8484

8585
set +x
8686
echo "Configuring PhpStorm..."
87-
if [ ${force_project_cleaning} -eq 1 ] && [ ${force_phpstorm_config_cleaning} -eq 1 ]; then
87+
if [[ ${force_project_cleaning} -eq 1 ]] && [[ ${force_phpstorm_config_cleaning} -eq 1 ]]; then
8888
rm -rf "${vagrant_dir}/.idea"
8989
fi
90-
if [ ! "$(ls -A ${vagrant_dir}/.idea)" ]; then
90+
if [[ ! "$(ls -A "${vagrant_dir}/.idea")" ]]; then
9191
bash "${vagrant_dir}/scripts/host/configure_php_storm.sh"
9292
fi
9393

scripts/host/composer.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ bash "${vagrant_dir}/scripts/host/check_requirements.sh"
1616
php_executable=$(bash "${vagrant_dir}/scripts/host/get_path_to_php.sh")
1717

1818
# Setup composer if necessary
19-
if [ ! -f ${composer_phar} ]; then
19+
if [[ ! -f ${composer_phar} ]]; then
2020
cd "${composer_dir}"
2121
curl -sS https://getcomposer.org/installer | ${php_executable}
2222
fi
2323

2424
# Configure composer credentials
2525
auth_json_already_exists=0
26-
if [ -f "${current_dir}/auth.json" ]; then
26+
if [[ -f "${current_dir}/auth.json" ]]; then
2727
auth_json_already_exists=1
2828
fi
2929

30-
if [ ! ${auth_json_already_exists} = 1 ] && [ -f ${composer_auth_json} ]; then
3130
cd "${current_dir}"
31+
if [[ ! ${auth_json_already_exists} = 1 ]] && [[ -f ${composer_auth_json} ]]; then
3232
cp "${composer_auth_json}" "${current_dir}/auth.json"
3333
fi
3434

@@ -40,6 +40,6 @@ else
4040
${php_executable} "${composer_phar}" --ignore-platform-reqs "$@"
4141
fi
4242

43-
if [ ! ${auth_json_already_exists} = 1 ] && [ -f "${current_dir}/auth.json" ]; then
43+
if [[ ! ${auth_json_already_exists} = 1 ]] && [[ -f "${current_dir}/auth.json" ]]; then
4444
rm "${current_dir}/auth.json"
4545
fi

scripts/host/get_path_to_php.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ vagrant_dir=$(cd "$(dirname "$0")/../.."; pwd)
66
set -ex
77

88
# Find path to available PHP
9-
if [ -f ${vagrant_dir}/lib/php/php.exe ]; then
9+
if [[ -f ${vagrant_dir}/lib/php/php.exe ]]; then
1010
php_executable="${vagrant_dir}/lib/php/php"
1111
else
1212
php_executable="php"

scripts/provision/configure_environment.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ vagrant_dir="/vagrant"
1515
# Enable Magento virtual host
1616
custom_virtual_host_config="${vagrant_dir}/etc/magento2_virtual_host.conf"
1717
default_virtual_host_config="${vagrant_dir}/etc/magento2_virtual_host.conf.dist"
18-
if [ -f ${custom_virtual_host_config} ]; then
18+
if [[ -f ${custom_virtual_host_config} ]]; then
1919
virtual_host_config=${custom_virtual_host_config}
2020
else
2121
virtual_host_config=${default_virtual_host_config}
@@ -38,7 +38,7 @@ if [ -f ${composer_auth_json} ]; then
3838
if [ ! -d /home/vagrant/.composer ] ; then
3939
sudo -H -u vagrant bash -c 'mkdir /home/vagrant/.composer'
4040
fi
41-
if [ -f ${composer_auth_json} ]; then
41+
if [[ -f ${composer_auth_json} ]]; then
4242
cp "${composer_auth_json}" "/home/vagrant/.composer/auth.json"
4343
fi
4444
fi

scripts/provision/configure_environment_recurring.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function process_php_config () {
55

66
for php_ini_path in "${php_ini_paths[@]}"
77
do
8-
if [ -f ${php_ini_path} ]; then
8+
if [[ -f ${php_ini_path} ]]; then
99
echo "date.timezone = America/Chicago" >> ${php_ini_path}
1010
sed -i "s|;include_path = \".:/usr/share/php\"|include_path = \".:/usr/share/php:${guest_magento_dir}/vendor/phpunit/phpunit\"|g" ${php_ini_path}
1111
sed -i "s|display_errors = Off|display_errors = On|g" ${php_ini_path}
@@ -50,7 +50,7 @@ if [ ! -f /etc/rc0.d/K04-unlink-configs ]; then
5050
fi
5151

5252
# Upgrade existing environment
53-
if [ -f ${vagrant_dir}/.idea/deployment.xml ]; then
53+
if [[ -f ${vagrant_dir}/.idea/deployment.xml ]]; then
5454
sed -i.back "s|magento2ce/var/generation|magento2ce/var|g" "${vagrant_dir}/.idea/deployment.xml"
5555
fi
5656

0 commit comments

Comments
 (0)