Skip to content

Commit f84f6ba

Browse files
committed
Refactor install-translations.sh
1 parent 053fc5d commit f84f6ba

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

bin/install-translations.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,24 @@ cd `dirname $0`
1111

1212
if [ $# -eq 0 ]; then
1313
echo "Install Translations for CodeIgniter System Messages"
14-
echo " usage: $0 <version>"
14+
echo " usage: $0 <version/branch>"
15+
echo " eg: $0 3.0.0"
1516
echo " eg: $0 master"
1617
exit
1718
fi
1819

1920
version="$1"
21+
zip="tmp-$$.zip"
2022

21-
curl -L -o translations.zip "https://github.com/bcit-ci/codeigniter3-translations/archive/$version.zip"
22-
unzip translations.zip
23+
curl -L -o "$zip" "https://github.com/$user/$repos/archive/$version.zip"
24+
unzip "$zip"
2325

2426
OS=`uname`
2527
if [ "$OS" = "Darwin" ]; then
26-
cp -rf "codeigniter3-translations-$version/language/" ../application/language/
28+
cp -rf "$repos-$version/language/" ../application/language/
2729
else
28-
cp -rf "codeigniter3-translations-$version/language/" -T ../application/language/
30+
cp -rf "$repos-$version/language/" -T ../application/language/
2931
fi
3032

31-
rm translations.zip
32-
rm -rf "codeigniter3-translations-$version"
33+
rm "$zip"
34+
rm -rf "$repos-$version"

0 commit comments

Comments
 (0)