Skip to content

Commit

Permalink
fix(rime-install): end recursive call
Browse files Browse the repository at this point in the history
  • Loading branch information
lotem committed Nov 2, 2018
1 parent fb4f829 commit 8ad6447
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions rime-install
Expand Up @@ -4,14 +4,10 @@ if [[ -z "${plum_repo}" ]]; then
plum_repo='rime/plum'
fi

run_from_plum_dir=0

if [[ -z "${plum_dir}" ]]; then
# am I in a working copy already?
plum_dir="$(dirname "$0")"
if [[ -f "${plum_dir}"/scripts/install-packages.sh ]]; then
run_from_plum_dir=1
else
if ! [[ -f "${plum_dir}"/scripts/install-packages.sh ]]; then
# make a copy of plum in a subdirectory
plum_dir='plum'
fi
Expand All @@ -21,8 +17,8 @@ if ! [[ -e "${plum_dir}" ]]; then
git clone --depth 1 "https://github.com/${plum_repo}.git" "${plum_dir}"
fi

if [[ "${run_from_plum_dir}" -eq 0 ]]; then
# run newer version of rime-install
if ! [[ "$0" -ef "${plum_dir}"/rime-install ]]; then
# run the newer version of rime-install
"${plum_dir}"/rime-install "$@"
exit
fi
Expand Down

0 comments on commit 8ad6447

Please sign in to comment.