This repository was archived by the owner on Jan 25, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed
Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change 2525 VERSION=" $1 "
2626fi
2727
28+ echo " # WPLib-Box: Updating /opt/box with version ${VERSION} "
29+ if [ -d " ${WPLIB_BOX_CLI_DIR} " ]
30+ then
31+ if [ -d " ${WPLIB_BOX_CLI_DIR} -LAST" ]
32+ then
33+ rm -rf " ${WPLIB_BOX_CLI_DIR} -LAST"
34+ fi
35+ mv " ${WPLIB_BOX_CLI_DIR} " " ${WPLIB_BOX_CLI_DIR} -LAST"
36+ fi
37+ mkdir -p ${WPLIB_BOX_CLI_DIR}
38+ sudo git clone -q ${WPLIB_BOX_SCRIPTS_REPO} ${WPLIB_BOX_CLI_DIR} > /dev/null
39+ cd ${WPLIB_BOX_CLI_DIR}
40+ sudo git checkout -q --force ${VERSION} > /dev/null
41+ echo $VERSION > /opt/box/version
42+ echo " Done"
43+
44+
45+
46+
2847
48+ exit
49+ # ###############################################################################
2950# Pull from GitHub.
3051if [ -d ${WPLIB_BOX_CLI_DIR} ]
3152then
3556 sudo git config --global user.email "user@wplib.com"
3657 sudo git config --global user.name "WPLib"
3758 sudo git clean -q -d -fx "" > /dev/null
38- sudo git pull > /dev/null 2>&1
59+ sudo git pull -q ${WPLIB_BOX_SCRIPTS_REPO} > /dev/null 2>&1
3960 sudo git checkout -q --force ${VERSION} > /dev/null
4061 echo $VERSION > /opt/box/version
4162 echo "Done"
63+ rm /tmp/self-update.$$
4264EOF
4365else
4466 cat << EOF > /tmp/self-update.$$
4567 echo "# WPLib-Box: Initializing /opt/box with version ${VERSION} "
4668 sudo git clone -q ${WPLIB_BOX_SCRIPTS_REPO} ${WPLIB_BOX_CLI_DIR} > /dev/null
4769 echo $VERSION > /opt/box/version
4870 echo "Done"
71+ rm /tmp/self-update.$$
4972EOF
5073fi
5174
5275chmod a+x /tmp/self-update.$$
53- exec /tmp/self-update.$$
76+ bash -x /tmp/self-update.$$
You can’t perform that action at this time.
0 commit comments