3 function __init_syncthing() {
11 # Every package should define these 6 variables
12 pkg_cmd_name="syncthing"
14 pkg_dst_cmd="$HOME/.local/bin/syncthing"
15 pkg_dst="$pkg_dst_cmd"
17 pkg_src_cmd="$HOME/.local/opt/syncthing-v$WEBI_VERSION/bin/syncthing"
18 pkg_src_dir="$HOME/.local/opt/syncthing-v$WEBI_VERSION"
19 pkg_src="$pkg_src_cmd"
22 # $HOME/.local/opt/syncthing-v1.12.1/bin
23 mkdir -p "$(dirname $pkg_src_cmd)"
25 # mv ./syncthing* "$HOME/.local/opt/syncthing-v1.12.1/bin/syncthing"
26 mv ./syncthing*/"$pkg_cmd_name"* "$pkg_src_cmd"
28 # chmod a+x "$HOME/.local/opt/syncthing-v1.12.1/bin/syncthing"
29 chmod a+x "$pkg_src_cmd"
32 # pkg_get_current_version is recommended, but (soon) not required
33 pkg_get_current_version() {
34 # 'syncthing version' has output in this format:
35 # syncthing v1.12.1 "Fermium Flea" (go1.15.5 darwin-amd64) teamcity@build.syncthing.net 2020-12-06 12:46:27 UTC
36 # This trims it down to just the version number:
38 echo "$(syncthing --version 2> /dev/null | head -n 1 | cut -d' ' -f2 | sed 's:^v::')"