X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=serviceman%2Finstall.sh;h=06ed1e7c89042762815d1a42ef3d2e41174bcc21;hb=72406c4e0d438b76da054be8d5eff42d08312498;hp=df808776fbc50bf4073cc5e7e2d92771c8105142;hpb=5e0debf4c54c1e55476c1bc533c26db2b54d2f77;p=webi-installers%2F.git diff --git a/serviceman/install.sh b/serviceman/install.sh index df80877..06ed1e7 100644 --- a/serviceman/install.sh +++ b/serviceman/install.sh @@ -1,54 +1,29 @@ #!/bin/bash -# title: Serviceman -# homepage: https://git.rootprojects.org/root/serviceman -# tagline: cross-platform service management for Linux, Mac, and Windows -# description: | -# A system laucher that wraps `launchctl` (macOS), `systemctl` (Linux), -# and the Windows Registry to work cross-platform. -# examples: | -# -# Works with anything, including -# -# ### Node.js -# -# ```bash -# serviceman add --name my-service node ./serve.js --port 3000 -# ``` -# -# ### Golang -# -# ```bash -# go build -mod vendor cmd/my-service -# serviceman add ./my-service --port 3000 -# ``` -# -# ### And even bash! -# -# ```bash -# serviceman add --name backuper bash ./backup.sh /mnt/data -# ``` +{ -set -e -set -u + set -e + set -u -# Test if in PATH -set +e -my_serviceman=$(command -v serviceman) -set -e -if [ -n "$my_serviceman" ]; then - if [ "$my_serviceman" != "$HOME/.local/bin/serviceman" ]; then - echo "a serviceman installation (which make take precedence) exists at:" - echo " $my_serviceman" - echo "" - fi -fi + # Test if in PATH + set +e + my_serviceman=$(command -v serviceman) + set -e + if [ -n "$my_serviceman" ]; then + if [ "$my_serviceman" != "$HOME/.local/bin/serviceman" ]; then + echo "a serviceman installation (which make take precedence) exists at:" + echo " $my_serviceman" + echo "" + fi + fi -# Get arch envs, etc -webi_download "https://rootprojects.org/serviceman/dist/$(uname -s)/$(uname -m)/serviceman" "$HOME/Downloads/serviceman" -chmod +x "$HOME/Downloads/serviceman" -mv "$HOME/Downloads/serviceman" "$HOME/.local/bin/" + # Get arch envs, etc + webi_download "https://rootprojects.org/serviceman/dist/$(uname -s)/$(uname -m)/serviceman" "$HOME/Downloads/serviceman" + chmod +x "$HOME/Downloads/serviceman" + mv "$HOME/Downloads/serviceman" "$HOME/.local/bin/" -# add to ~/.local/bin to PATH, just in case -webi_path_add $HOME/.local/bin # > /dev/null 2> /dev/null -# TODO inform user to add to path, apart from pathman? + # add to ~/.local/bin to PATH, just in case + webi_path_add $HOME/.local/bin # > /dev/null 2> /dev/null + # TODO inform user to add to path, apart from pathman? + +}