Skip to content

Commit

Permalink
Merge pull request #185 from davidnuescheler/master
Browse files Browse the repository at this point in the history
added permissions and improved symlink handling
  • Loading branch information
stefan-guggisberg authored Sep 11, 2018
2 parents 6654735 + 7adaf87 commit 77f455a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions build/archive/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,19 @@ ask() {
done
}

if [ -f $dest ]; then
old_version=$($dest --version)
if ! ask "hlx version $old_version ($dest) exists, overwrite?" Y; then
exit 1
if [ -L $dest -o -f $dest ]; then
if [ -x $dest ]; then
old_version=$($dest --version)
if ! ask "hlx version $old_version ($dest) exists, overwrite?" Y; then
exit 1
fi
else
rm $dest
fi
fi

if cp a.out $dest; then
chmod 755 $dest # TODO: respect umask
version=$($dest --version)
echo "hlx version $version successfully installed: $dest"
else
Expand Down

0 comments on commit 77f455a

Please sign in to comment.