Skip to content

Commit

Permalink
fix tar zip and install script
Browse files Browse the repository at this point in the history
  • Loading branch information
principis committed Apr 13, 2019
1 parent 7c96aec commit fdab485
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ addons:
apt:
packages:
- fakeroot
- rpm

solution: tldr-sharp.sln
script:
Expand Down
19 changes: 12 additions & 7 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
12 changes: 7 additions & 5 deletions scripts/linux_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand Down

0 comments on commit fdab485

Please sign in to comment.