This repository was archived by the owner on Oct 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathm-switch-to-ee
executable file
·47 lines (37 loc) · 1.87 KB
/
m-switch-to-ee
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
#!/usr/bin/env bash
vagrant_dir=$(cd "$(dirname "$0")"; pwd)
magento_ce_dir="${vagrant_dir}/magento2ce"
magento_ee_dir="${magento_ce_dir}/magento2ee"
host_os=$(bash "${vagrant_dir}/scripts/host/get_host_os.sh")
php_executable=$(bash "${vagrant_dir}/scripts/host/get_path_to_php.sh")
# Enable trace printing and exit on the first error
set -ex
if [ ! -f ${magento_ee_dir}/app/etc/aliases_to_classes_map.json ]; then
echo "EE codebase is not available"
exit 0
fi
if [ -f ${magento_ce_dir}/app/etc/aliases_to_classes_map.json ]; then
echo "Already switched to EE"
exit 0
fi
${php_executable} -f ${magento_ee_dir}/dev/tools/build-ee.php -- --command=link --ee-source="${magento_ee_dir}" --ce-source="${magento_ce_dir}"
cp ${magento_ee_dir}/composer.json ${magento_ce_dir}/composer.json
cp ${magento_ee_dir}/composer.lock ${magento_ce_dir}/composer.lock
if [[ ${host_os} == "Windows" || $(bash "${vagrant_dir}/scripts/get_config_value.sh" "guest_use_nfs") == 0 ]]; then
# Prevent issues on Windows with incorrect symlinks to files
if [ -f ${magento_ee_dir}/app/etc/aliases_to_classes_map.json ]; then
rm ${magento_ce_dir}/app/etc/aliases_to_classes_map.json
cp ${magento_ee_dir}/app/etc/aliases_to_classes_map.json ${magento_ce_dir}/app/etc/aliases_to_classes_map.json
fi
if [ -f ${magento_ee_dir}/app/etc/enterprise/di.xml ]; then
rm ${magento_ce_dir}/app/etc/enterprise/di.xml
cp ${magento_ee_dir}/app/etc/enterprise/di.xml ${magento_ce_dir}/app/etc/enterprise/di.xml
fi
fi
bash "${vagrant_dir}/m-clear-cache"
bash -c "${vagrant_dir}/m-composer install"
echo "Magento installation..."
if [[ ${host_os} == "Windows" || $(bash "${vagrant_dir}/scripts/get_config_value.sh" "guest_use_nfs") == 0 ]]; then
read -p "Wait while Magento2 code is uploaded in PhpStorm and press any key to continue..." -n1 -s
fi
bash "${vagrant_dir}/m-reinstall"