X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=_example%2Finstall.sh;h=bd4a692582c719833cbf2a221f8b56fed059b593;hb=b80057d427867b81bc6e393abe0bf30ad5bc2705;hp=280997cd7af9a93c1e61a8f4ff4a1fb7c63d79df;hpb=23070c23f616758660b7acfaec7746c8a4dafabb;p=webi-installers%2F.git diff --git a/_example/install.sh b/_example/install.sh index 280997c..bd4a692 100644 --- a/_example/install.sh +++ b/_example/install.sh @@ -1,5 +1,8 @@ #!/bin/bash +# shellcheck disable=SC2034 +# "'pkg_cmd_name' appears unused. Verify it or export it." + function __init_foobar() { set -e set -u @@ -21,19 +24,21 @@ function __init_foobar() { # pkg_install must be defined by every package pkg_install() { # ~/.local/opt/foobar-v0.99.9/bin - mkdir -p "$(dirname $pkg_src_cmd)" + mkdir -p "$(dirname "${pkg_src_cmd}")" # mv ./foobar-*/foo ~/.local/opt/foobar-v0.99.9/bin/foo - mv ./foobar-*/foo "$pkg_src_cmd" + mv ./foobar-*/foo "${pkg_src_cmd}" } - # pkg_get_current_version is recommended, but (soon) not required + # pkg_get_current_version is recommended, but not required pkg_get_current_version() { # 'foo --version' has output in this format: # foobar 0.99.9 (rev abcdef0123) # This trims it down to just the version number: # 0.99.9 - echo $(foo --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2) + foo --version 2> /dev/null | + head -n 1 | + cut -d ' ' -f 2 } }