Skip to content

Commit 70483b4

Browse files
committed
feat(install-plugins.sh): git-clone or update plugins
1 parent c7ce66f commit 70483b4

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

install-plugins.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
cd "$(dirname "$0")"
4+
5+
for slug in "$@"
6+
do
7+
plugin_project="${slug##*/}"
8+
plugin_dir="plugins/${plugin_project#librime-}"
9+
if [[ -d "${plugin_dir}" ]]
10+
then
11+
echo "Updating plugin: ${plugin_dir}"
12+
git -C "${plugin_dir}" checkout master
13+
git -C "${plugin_dir}" pull
14+
else
15+
git clone --depth 1 "https://github.com/${slug}.git" "${plugin_dir}"
16+
fi
17+
done

travis-install-plugins.sh

-12
This file was deleted.

travis-install.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,15 @@ if [[ "$TRAVIS_OS_NAME" == linux ]]; then
1919
make -C thirdparty/src/opencc build
2020
sudo env "PATH=$PATH" make -C thirdparty/src/opencc install
2121
elif [[ "$TRAVIS_OS_NAME" == osx ]]; then
22-
make -f xcode.mk thirdparty
22+
make xcode/thirdparty
2323
fi
2424

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

0 commit comments

Comments
 (0)