Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 10, 2020. It is now read-only.

Commit f06bd15

Browse files
committed
Cleanup script and add update functionality
Signed-off-by: Mriyam Tamuli <mbtamuli@gmail.com>
1 parent 8506378 commit f06bd15

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

‎scripts/ee4‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ initEE4() {
277277
fi
278278

279279
if [[ $# -eq 0 ]]; then
280-
read -p "Where would you like to create your sites(default: ~/Documents/Sites): "
281-
WEBROOT="${REPLY:-~/Documents/Sites}"
280+
read -p "Where would you like to create your sites(default: ~/Sites): "
281+
WEBROOT="${REPLY:-~/Sites}"
282282
elif [[ $# -eq 1 ]]; then
283283
WEBROOT="1ドル"
284284
fi
@@ -289,12 +289,13 @@ initEE4() {
289289
updateEE4() {
290290
REPO_URL="${1:-https://github.com/EasyEngine/docker-compose-wordpress}"
291291
VERSION="${2:-master}"
292+
EE_TMP_ROOT="$(mktemp -dt ee-installer-XXXXXX)"
293+
EE_TMP_REPO="$EE_TMP_ROOT/docker-compose-wordpress"
292294

293-
echo "git pull -b "$VERSION" "$REPO_URL""
294-
295-
pushd "$EE_INSTALL_DIR" > /dev/null 2>&1
296-
git pull "$REPO_URL" "$VERSION"
297-
popd > /dev/null 2>&1
295+
echo "Updating ee4"
296+
git clone -b "$VERSION" "$REPO_URL" "$EE_TMP_REPO"
297+
runAsRoot cp -r "$EE_TMP_REPO/*" "$EE_INSTALL_DIR"
298+
rm -rf "$EE_TMP_ROOT"
298299
}
299300

300301
# Execution

‎scripts/setup‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ cloneRepo() {
7171
EE_TMP_REPO="$EE_TMP_ROOT/docker-compose-wordpress"
7272
echo "Clone repo $REPO_URL"
7373
git clone -b "$VERSION" "$REPO_URL" "$EE_TMP_REPO"
74-
ls -al "$EE_TMP_REPO"
7574
}
7675

7776
# installScript installs the main script.
@@ -86,9 +85,7 @@ installScript() {
8685

8786
rm -rf "$EE_INSTALL_DIR"
8887
echo "Preparing to install into $EE_INSTALL_DIR"
89-
ls -al "$EE_TMP_REPO"
9088
runAsRoot cp -r "$EE_TMP_REPO" "$EE_INSTALL_DIR"
91-
ls -al "$EE_INSTALL_DIR"
9289
runAsRoot ln -s "$EE_INSTALL_DIR/$EE_SCRIPT" "$EE_SCRIPT_INSTALL_PATH"
9390
echo -e "\nInstall complete!"
9491
initEE4
@@ -120,4 +117,4 @@ if ! testInstalled; then
120117
cloneRepo
121118
installScript
122119
fi
123-
#cleanup
120+
cleanup

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /