build(install): updated local and remote install scripts to use /usr/local/bin when applicable

This commit is contained in:
Will Moss
2024-01-06 01:08:40 +01:00
parent 27be63ed40
commit f25b54a16f
3 changed files with 20 additions and 9 deletions

View File

@@ -168,7 +168,7 @@ curl https://raw.githubusercontent.com/will-moss/isaiah/master/scripts/remote-in
```
This script will try to automatically download a binary that matches your operating system and architecture, and put it
in your `/usr/bin/` directory to ease running it. Later on, you can run :
in your `/usr/[local/]bin/` directory to ease running it. Later on, you can run :
```sh
# Create a new .env file
@@ -226,14 +226,14 @@ isaiah
# rm -rf ./isaiah
```
The local install script will try to perform a production build on your machine, and move `isaiah` to your `/usr/bin/` directory
The local install script will try to perform a production build on your machine, and move `isaiah` to your `/usr/[local/]bin/` directory
to ease running it. In more details, the following actions are performed :
- Local install of Babel, LightningCSS, Less, and Terser
- Prefixing, Transpilation, and Minification of CSS and JS assets
- Building of the Go source code into a single-file executable (with CSS and JS embed)
- Cleaning of the artifacts generated during the previous steps
- Removal of the previous `isaiah` executable, if any in `/usr/bin/`
- Moving the new `isaiah` executable in `/usr/bin` with `755` permissions.
- Removal of the previous `isaiah` executable, if any in `/usr/[local/]bin/`
- Moving the new `isaiah` executable in `/usr/[local/]bin` with `755` permissions.
If you encounter any issue during this process, please feel free to tweak the install script or reach out by opening an issue.

View File

@@ -30,9 +30,14 @@ rm -f ./client/assets/css/tmp.css
rm -f ./client/assets/css/style.css
mv ./client/assets/js/isaiah.backup.js ./client/assets/js/isaiah.js
DESTINATION="/usr/bin"
if [ -d "/usr/local/bin" ]; then
DESTINATION="/usr/local/bin"
fi
# Remove any previous installation
rm -f /usr/bin/isaiah
rm -f $DESTINATION/isaiah
# Install the app's binary
mv isaiah /usr/bin/
chmod 755 /usr/bin/isaiah
mv isaiah $DESTINATION/
chmod 755 $DESTINATION/isaiah

View File

@@ -17,6 +17,12 @@ GITHUB_URL="https://github.com/will-moss/isaiah/releases/download/${GITHUB_LATES
# Install/Update the local binary
curl -L -o isaiah.tar.gz $GITHUB_URL
tar xzvf isaiah.tar.gz isaiah
mv isaiah /usr/bin/
chmod 755 /usr/bin/isaiah
DESTINATION="/usr/bin"
if [ -d "/usr/local/bin" ]; then
DESTINATION="/usr/local/bin"
fi
mv isaiah $DESTINATION
chmod 755 $DESTINATION/isaiah
rm isaiah.tar.gz