Last active
August 9, 2016 17:06
-
-
Save pyk/f2617d55e1dffdd5bcc31f33927ec745 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NEW_VERSION=206179d | |
OLD_VERSION=cd5726e | |
if [ ! -f "${NEW_VERSION}.tar.gz" ]; then | |
wget https://api.github.com/repos/facebookresearch/fasttext/tarball/${NEW_VERSION} -O ${NEW_VERSION}.tar.gz | |
else | |
echo "fastText: ${NEW_VERSION}.tar.gz exists" | |
fi | |
if [ ! -d "facebookresearch-fastText-${OLD_VERSION}" ]; then | |
if [ -d "fasttext/cpp" ]; then | |
echo "fasttext: backup fasttext/cpp to facebookresearch-fastText-${OLD_VERSION}" | |
mv fasttext/cpp facebookresearch-fastText-${OLD_VERSION} | |
else | |
echo "fastText: fastText/cpp directory not exists" | |
echo "fastText: Plase copy facebookresearch-fastText-${NEW_VERSION} to fasttext/cpp" | |
eccho "% cp -r facebookresearch-fastText-${NEW_VERSION} fasttext/cpp" | |
exit 1 | |
fi | |
if [ ! -d "facebookresearch-fastText-${NEW_VERSION}" ]; then | |
tar xzfv ${NEW_VERSION}.tar.gz | |
fi | |
cp -r facebookresearch-fastText-${NEW_VERSION} fasttext/cpp | |
else | |
echo "fastText: Old version already moved" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment