Skip to content

Commit

Permalink
feat(install-plugins.sh): git-clone or update plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
lotem committed Apr 1, 2019
1 parent c7ce66f commit 70483b4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
17 changes: 17 additions & 0 deletions install-plugins.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

cd "$(dirname "$0")"

for slug in "$@"
do
plugin_project="${slug##*/}"
plugin_dir="plugins/${plugin_project#librime-}"
if [[ -d "${plugin_dir}" ]]
then
echo "Updating plugin: ${plugin_dir}"
git -C "${plugin_dir}" checkout master
git -C "${plugin_dir}" pull
else
git clone --depth 1 "https://github.com/${slug}.git" "${plugin_dir}"
fi
done
12 changes: 0 additions & 12 deletions travis-install-plugins.sh

This file was deleted.

11 changes: 8 additions & 3 deletions travis-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@ if [[ "$TRAVIS_OS_NAME" == linux ]]; then
make -C thirdparty/src/opencc build
sudo env "PATH=$PATH" make -C thirdparty/src/opencc install
elif [[ "$TRAVIS_OS_NAME" == osx ]]; then
make -f xcode.mk thirdparty
make xcode/thirdparty
fi

if [[ -n "${RIME_PLUGINS}" ]]; then
# intentionally not quoted: ${RIME_PLUGIN} is a space separated list of slugs
bash ./travis-install-plugins.sh ${RIME_PLUGINS}
# intentionally unquoted: ${RIME_PLUGINS} is a space separated list of slugs
bash ./install-plugins.sh ${RIME_PLUGINS}
for plugin_dir in plugins/*; do
if [[ -e "${plugin_dir}/travis-install.sh" ]]; then
bash "${plugin_dir}/travis-install.sh"
fi
done
fi

0 comments on commit 70483b4

Please sign in to comment.