2 # homepage: https://github.com/gohugoio/hugo
3 # tagline: The world’s fastest framework for building websites
5 # Hugo is one of the most popular open-source static site generators. With its amazing speed and flexibility, Hugo makes building websites fun again.
19 pkg_common_opt="$HOME/.local"
21 # just a junk file so that the version check always fails for non-current versions
22 pkg_new_opt="$HOME/.local/opt/hugo-doesntexist111"
24 pkg_get_current_version() {
25 # 'hugo version' has output in this format:
26 # Hugo Static Site Generator v0.72.0-8A7EF3CF darwin/amd64 BuildDate: 2020-05-31T12:07:44Z
27 # This trims it down to just the version number:
29 echo "$(hugo version 2>/dev/null | head -n 1 | cut -d' ' -f5 | cut -d '-' -f1 | sed 's:^v::')"
32 pkg_format_cmd_version() {
33 # 'node v12.8.0' is the canonical version format for node
35 echo "$pkg_cmd_name v$my_version"
38 pkg_link_new_version() {
39 # hugo is just a single file, no directory linking to do
44 # if selected version is installed, quit
46 # will save to ~/Downloads/$WEBI_PKG_FILE by default
48 # supported formats (.xz, .tar.*, .zip) will be extracted to $WEBI_TMP
53 pushd "$WEBI_TMP" 2>&1 >/dev/null
55 # rename the entire extracted folder to the new location
56 # (this will be "$HOME/.local/opt/node-v$WEBI_VERSION" by default)
57 mkdir -p "$pkg_common_bin"
58 mv ./"$pkg_cmd_name"* "$pkg_common_cmd"
64 # just in case we add something in the future
67 # web_path_add is defined in webi/template.bash at https://github.com/webinstall/packages
68 # Adds "$HOME/.local/opt/node" to PATH
69 webi_path_add "$pkg_common_bin"