diff --git a/.travis.yml b/.travis.yml index 0dc6876..10a2b66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ addons: apt: packages: - fakeroot - - rpm solution: tldr-sharp.sln script: diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 9df4b6e..69961e1 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -6,15 +6,20 @@ if ([ ! -z "$TRAVIS_TAG" ]) && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then create_archives() { - # Windows archives - zip -r "tldr-sharp_${TRAVIS_TAG#v}_windows${PLATFORM}.zip" $TARGET/* + + cd $TARGET + + # Windows archives + zip -r "../tldr-sharp_${TRAVIS_TAG#v}_windows${PLATFORM}.zip" * - # Linux archives - rm $TARGET/Mono.Data.Sqlite.dll || true # not necessary on linux - tar czf "tldr-sharp_${TRAVIS_TAG#v}_linux${PLATFORM}.tar.gz" $TARGET/* + # Linux archives + rm $TARGET/Mono.Data.Sqlite.dll || true # not necessary on linux + tar czf "../tldr-sharp_${TRAVIS_TAG#v}_linux${PLATFORM}.tar.gz" * - # Linux install scripts - sed -e "s/VERSION_PLACEHOLDER/$TRAVIS_TAG/" -e "s/FILE_PLACEHOLDER/tldr-sharp_${TRAVIS_TAG#v}_linux${PLATFORM}/" ../../scripts/linux_install.sh > tldr-sharp_linux${PLATFORM}.sh + cd .. + + # Linux install scripts + sed -e "s/VERSION_PLACEHOLDER/$TRAVIS_TAG/" -e "s/FILE_PLACEHOLDER/tldr-sharp_${TRAVIS_TAG#v}_linux${PLATFORM}/" ../../scripts/linux_install.sh > tldr-sharp_linux${PLATFORM}.sh } build_deb() { diff --git a/scripts/linux_install.sh b/scripts/linux_install.sh index 6e95c92..8482689 100644 --- a/scripts/linux_install.sh +++ b/scripts/linux_install.sh @@ -6,8 +6,8 @@ tldrLib='/usr/local/lib' tldrBin='/usr/local/bin' cd /tmp -if [ -d "/tmp/tldr" ]; then - sudo rm -rf "/tmp/tldr" +if [ -d "/tmp/tldr" ] || [ -f "/tmp/tldr" ]; then + rm -rf "/tmp/tldr" fi # Download release @@ -23,9 +23,9 @@ fi # Extract release -tar xzf VERSION_PLACEHOLDER.tar.gz -C tldr -rm VERSION_PLACEHOLDER.tar.gz -if [ -d "$tldrLib/tldr" ]; then +tar xzf FILE_PLACEHOLDER.tar.gz -C tldr +rm FILE_PLACEHOLDER.tar.gz +if [ -d "$tldrLib/tldr" ] || [ -f "$tldrLib/tldr" ]; then sudo rm -rf "$tldrLib/tldr" 2> /dev/null fi @@ -39,6 +39,8 @@ if [ $retval != 0 ]; then exit 1 fi +rm -rf "/tmp/tldr" + # Download executable wget -q https://raw.githubusercontent.com/principis/tldr-sharp/master/tldr