Skip to content

Commit

Permalink
improve(install) : improve install script
Browse files Browse the repository at this point in the history
  • Loading branch information
LordPax committed Aug 8, 2024
1 parent 3c0b12f commit 451250e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

* Move main command in `commands/base.go`
* Minor text changes
* Improve install script

## [1.2.0] - 2024-05-07

Expand Down
20 changes: 18 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
#!/bin/bash

[ ! -f scan2epub ] && echo "scan2epub not found" && exit 1
install -Dm 755 scan2epub ~/.local/bin/scan2epub
[ "$EUID" -ne 0 ] && echo "Please run as root" && exit 1

function installFunc() {
[ ! -f scan2epub ] && echo "scan2epub not found" && exit 1
echo "Installing scan2epub to /usr/bin/scan2epub"
install -Dm 755 scan2epub /usr/bin/scan2epub
}

function uninstall() {
echo "Uninstalling scan2epub from /usr/bin/scan2epub"
rm -f /usr/bin/scan2epub
}

case "$1" in
help) echo "Usage: $0 {install|uninstall}" ;;
uninstall) uninstall ;;
*) installFunc ;;
esac

0 comments on commit 451250e

Please sign in to comment.