X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=caddy%2Finstall.sh;h=c0980b99e45e287858b39db0f5bbbeaa87e2c819;hb=ae2e7d7229e9e9c316e1148e47ed4b97973edc02;hp=01481948923cc1803695192444ed48fefe1e386b;hpb=5e0debf4c54c1e55476c1bc533c26db2b54d2f77;p=webi-installers%2F.git diff --git a/caddy/install.sh b/caddy/install.sh index 0148194..c0980b9 100644 --- a/caddy/install.sh +++ b/caddy/install.sh @@ -1,32 +1,35 @@ #!/bin/bash -# This file only defines custom functions which may be unique to installing Caddy. -# For the generic functions (version comparison, downloading, symlinking) which -# are used by almost all installers, see `template.bash`: -# - https://github.com/webinstall/packages/branches/master/webi/template.bash +# "This is too simple" you say! "Where is the magic!?" you ask. +# There is no magic! +# The custom functions for Caddy are here. +# The generic functions - version checks, download, extract, etc - are here: +# - https://github.com/webinstall/packages/branches/master/_webi/template.sh set -e set -u pkg_cmd_name="caddy" + +# IMPORTANT: this let's other functions know to expect this to be a single file WEBI_SINGLE=true pkg_get_current_version() { # 'caddy version' has output in this format: # v2.1.0 h1:pQSaIJGFluFvu8KDGDODV8u4/QRED/OPyIR+MWYYse8= # This trims it down to just the version number: - # 2.0.0 - echo "$(caddy version 2>/dev/null | head -n 1 | cut -d' ' -f1 | sed 's:^v::')" + # 2.1.0 + echo "$(caddy version 2> /dev/null | head -n 1 | cut -d' ' -f1 | sed 's:^v::')" } pkg_install() { - # $HOME/.local/xbin + # $HOME/.local/opt/caddy-v2.1.0/bin mkdir -p "$pkg_src_bin" - # mv ./caddy* "$HOME/.local/xbin/caddy-v2.0.0" + # mv ./caddy* "$HOME/.local/opt/caddy-v2.1.0/bin/caddy" mv ./"$pkg_cmd_name"* "$pkg_src_cmd" - # chmod a+x "$HOME/.local/xbin/caddy-v2.0.0" + # chmod a+x "$HOME/.local/opt/caddy-v2.1.0/bin/caddy" chmod a+x "$pkg_src_cmd" } @@ -34,6 +37,6 @@ pkg_link() { # rm -f "$HOME/.local/bin/caddy" rm -f "$pkg_dst_cmd" - # ln -s "$HOME/.local/xbin/caddy-v2.0.0" "$HOME/.local/bin/caddy" + # ln -s "$HOME/.local/opt/caddy-v2.1.0/bin/caddy" "$HOME/.local/bin/caddy" ln -s "$pkg_src_cmd" "$pkg_dst_cmd" }