X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=_example%2Finstall.sh;h=cebf7a415cca647e8a4d8a964e6acf37c6d6c7d4;hb=2d68b08174ff6d37b5b3f42e51d5e9802d96e2a0;hp=6ae2b2ec7ac1b1bda5d424af6ef35bf74abf0943;hpb=1c97e1c661fd9739d71079b60e90ab2419d4531c;p=webi-installers%2F.git diff --git a/_example/install.sh b/_example/install.sh index 6ae2b2e..cebf7a4 100644 --- a/_example/install.sh +++ b/_example/install.sh @@ -1,6 +1,6 @@ #!/bin/bash -{ +function __init_foobar() { set -e set -u @@ -27,13 +27,17 @@ 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 } } + +__init_foobar