Compare commits
9 Commits
7ef957c2d7
...
v0.5.0
| Author | SHA1 | Date | |
|---|---|---|---|
| d7c8c7a43a | |||
| 1cd3edc90c | |||
| 0e768c9f61 | |||
| 1fcd775cc5 | |||
| 203a1ed147 | |||
| ef1914ee5c | |||
| 084b101e31 | |||
| b2db128aa9 | |||
| 081e880fb6 |
10
update.sh
10
update.sh
@@ -6,8 +6,9 @@ CPOLIS_DIR=$EXTRACTION_DIR/cpolis
|
|||||||
TAILWINDCSS_REPO_URL=https://api.github.com/repos/tailwindlabs/tailwindcss/releases/latest
|
TAILWINDCSS_REPO_URL=https://api.github.com/repos/tailwindlabs/tailwindcss/releases/latest
|
||||||
TMP_DIR=/tmp
|
TMP_DIR=/tmp
|
||||||
BIN_DIR=/usr/local/bin
|
BIN_DIR=/usr/local/bin
|
||||||
|
SYSTEMD_DIR=/lib/systemd/system
|
||||||
|
|
||||||
! groups | grep -E 'root|wheel|sudo' >/dev/null && echo "You need administrative privileges for this script" && exit 1
|
! groups | grep -E 'root|wheel|sudo' && echo "You need administrative privileges for this script" && exit 1
|
||||||
|
|
||||||
! which curl >/dev/null 2>&1 && echo "curl needs to be installed" >&2 && exit 1
|
! which curl >/dev/null 2>&1 && echo "curl needs to be installed" >&2 && exit 1
|
||||||
! which go >/dev/null 2>&1 && echo "go needs to be installed" >&2 && exit 1
|
! which go >/dev/null 2>&1 && echo "go needs to be installed" >&2 && exit 1
|
||||||
@@ -15,14 +16,12 @@ BIN_DIR=/usr/local/bin
|
|||||||
! which tar >/dev/null 2>&1 && echo "tar needs to be installed" >&2 && exit 1
|
! which tar >/dev/null 2>&1 && echo "tar needs to be installed" >&2 && exit 1
|
||||||
! which xargs >/dev/null 2>&1 && echo "xargs needs to be installed" >&2 && exit 1
|
! which xargs >/dev/null 2>&1 && echo "xargs needs to be installed" >&2 && exit 1
|
||||||
|
|
||||||
echo -e '\nDownloading cpolis...'
|
|
||||||
rm -fr $CPOLIS_DIR/*
|
rm -fr $CPOLIS_DIR/*
|
||||||
latest_release=$(curl -s $CPOLIS_REPO_URL | jq -r '.[0].tag_name')
|
latest_release=$(curl -s $CPOLIS_REPO_URL | jq -r '.[0].tag_name')
|
||||||
curl -Lo $TMP_DIR/cpolis.tar.gz https://git.streifling.com/jason/cpolis/archive/$latest_release.tar.gz
|
curl -Lo $TMP_DIR/cpolis.tar.gz https://git.streifling.com/jason/cpolis/archive/$latest_release.tar.gz
|
||||||
tar -xzf $TMP_DIR/cpolis.tar.gz -C $EXTRACTION_DIR
|
tar -xzf $TMP_DIR/cpolis.tar.gz -C $EXTRACTION_DIR
|
||||||
rm $TMP_DIR/cpolis.tar.gz
|
rm $TMP_DIR/cpolis.tar.gz
|
||||||
|
|
||||||
echo -e '\nDownloading TailwindCSS...'
|
|
||||||
curl -s $TAILWINDCSS_REPO_URL |
|
curl -s $TAILWINDCSS_REPO_URL |
|
||||||
grep -F browser_download_url |
|
grep -F browser_download_url |
|
||||||
grep -F linux-x64 |
|
grep -F linux-x64 |
|
||||||
@@ -32,11 +31,10 @@ chmod +x $CPOLIS_DIR/tailwindcss
|
|||||||
$CPOLIS_DIR/tailwindcss -i web/static/css/input.css -o web/static/css/style.css
|
$CPOLIS_DIR/tailwindcss -i web/static/css/input.css -o web/static/css/style.css
|
||||||
|
|
||||||
go build -o $TMP_DIR/cpolis $CPOLIS_DIR/cmd/main.go
|
go build -o $TMP_DIR/cpolis $CPOLIS_DIR/cmd/main.go
|
||||||
|
|
||||||
echo -e 'Setting system files up'
|
|
||||||
sudo mv $TMP_DIR/cpolis $BIN_DIR/cpolis
|
sudo mv $TMP_DIR/cpolis $BIN_DIR/cpolis
|
||||||
chmod +x $BIN_DIR/cpolis
|
chmod +x $BIN_DIR/cpolis
|
||||||
|
|
||||||
sudo mv $CPOLIS_DIR/cpolis.service /etc/systemd/system
|
[ ! -f $SYSTEMD_DIR ] && mkdir -p $SYSTEMD_DIR
|
||||||
|
sudo mv $CPOLIS_DIR/cpolis.service $SYSTEMD_DIR
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
sudo systemctl is-active --quiet cpolis.service && sudo systemctl restart cpolis.service
|
sudo systemctl is-active --quiet cpolis.service && sudo systemctl restart cpolis.service
|
||||||
|
|||||||
Reference in New Issue
Block a user