2 # homepage: https://github.com/caddyserver/caddy
3 # tagline: Fast, multi-platform web server with automatic HTTPS
5 # Caddy is an extensible server platform that uses TLS by default.
18 new_caddy="${HOME}/.local/bin/caddy"
20 # Test for existing version
22 cur_caddy="$(command -v caddy)"
24 if [ -n "$cur_caddy" ]; then
25 cur_ver=$(caddy version | head -n 1 | cut -d ' ' -f 2)
26 if [ "$cur_ver" == "$WEBI_VERSION" ]; then
27 echo "caddy v$WEBI_VERSION already installed at $cur_caddy"
29 elif [ "$cur_caddy" != "$new_caddy" ]; then
30 echo "WARN: possible conflict with caddy v$WEBI_VERSION at $cur_caddy"
34 # Note: this file is `source`d by the true installer and hence will have the webi functions
36 # because we created releases.js we can use webi_download()
37 # downloads caddy to ~/Downloads
40 # because this is tar or zip, we can webi_extract()
41 # extracts to the WEBI_TMP directory, raw (no --strip-prefix)
44 pushd "$WEBI_TMP" 2>&1 >/dev/null
45 echo Installing caddy v${WEBI_VERSION} as "$new_caddy"
46 mv ./caddy "$HOME/.local/bin/"
53 # TODO get better output from pathman / output the path to add as return to webi bootstrap
54 webi_path_add "$HOME/.local/bin"
56 echo "Installed 'caddy'"