Skip to content

Commit

Permalink
feat: add install bash
Browse files Browse the repository at this point in the history
  • Loading branch information
beliven-fabrizio-gortani committed Dec 27, 2024
1 parent bb06d96 commit db51cb4
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

trap _cleanup EXIT

_cleanup() {
rm -rf /tmp/archive.zip
rm -rf /tmp/archive
}

echo "Download the latest relase..."

LATEST_RELEASE=$(curl -s https://api.github.com/repos/beliven-it/laravel-sync/releases/latest | grep "zipball_url" | cut -d '"' -f 4)

echo "Latest release: $LATEST_RELEASE"

if [ -n "$LATEST_RELEASE" ]; then
curl -sL "$LATEST_RELEASE" -o /tmp/archive.zip
unzip -q -j /tmp/archive.zip -d /tmp/archive
cp -r /tmp/archive/laravel-sync .
chmod +x laravel-sync
echo "Done!"
else
echo "Cannot find the latest release"
exit 1
fi

0 comments on commit db51cb4

Please sign in to comment.