Commit 0e47104 1 parent 5c03e13 commit 0e47104 Copy full SHA for 0e47104
File tree 3 files changed +36
-5
lines changed
3 files changed +36
-5
lines changed Original file line number Diff line number Diff line change 27
27
- run : ./wshandler install_test_deps
28
28
- run : sudo ./wshandler --policy download install /usr/bin/
29
29
- run : make test WSHANDLER=wshandler
30
+ - run : sudo ./wshandler upgrade /usr/bin/
31
+ - run : wshandler --version
30
32
31
33
ubuntu22-snap-yq :
32
34
runs-on : ubuntu-22.04
35
37
- run : ./wshandler install_test_deps
36
38
- run : sudo ./wshandler --policy snap install /usr/bin/
37
39
- run : make test WSHANDLER=wshandler
40
+ - run : sudo ./wshandler upgrade /usr/bin/
41
+ - run : wshandler --version
38
42
39
43
appimage :
40
44
runs-on : ubuntu-latest
44
48
- run : make appimage ARCH=x86_64 YQ_ARCH=amd64 WSHANDLER_VERSION=1.1.1
45
49
- run : make appimage ARCH=aarch64 YQ_ARCH=arm64
46
50
- run : make test WSHANDLER=./build/appimage/wshandler-x86_64.AppImage
51
+ - run : sudo ./build/appimage/wshandler-x86_64.AppImage upgrade_appimage /usr/bin/
52
+ - run : wshandler --version
Original file line number Diff line number Diff line change @@ -85,6 +85,8 @@ Package repository commands:
85
85
wshandler installation commands:
86
86
install_test_deps
87
87
[-p|--policy {skip_yq}|snap|download] install <BIN_PATH {~/bin}>
88
+ upgrade <BIN_PATH {~/bin}>
89
+ upgrade_appimage <BIN_PATH {~/bin}>
88
90
```
89
91
90
92
Examples
Original file line number Diff line number Diff line change 67
67
echo " wshandler installation commands:"
68
68
echo " install_test_deps"
69
69
echo " [-p|--policy {skip_yq}|snap|download] install <BIN_PATH {~/bin}>"
70
+ echo " upgrade <BIN_PATH {~/bin}>"
71
+ echo " upgrade_appimage <BIN_PATH {~/bin}>"
70
72
71
73
exit " ${EXIT_CODE} "
72
74
}
@@ -715,6 +717,15 @@ snap_install()
715
717
sudo snap install " $@ "
716
718
}
717
719
720
+ wsh_download ()
721
+ {
722
+ if ! command -v " wget" > /dev/null
723
+ then
724
+ apt_install wget
725
+ fi
726
+ wget -O - " $@ "
727
+ }
728
+
718
729
719
730
WSH_SOURCE_TYPES=" git"
720
731
WSH_COMMAND_POLICY=default
846
857
snap_install yq
847
858
;;
848
859
download)
849
- if ! command -v " wget" > /dev/null
850
- then
851
- apt_install wget
852
- fi
853
- wget -O - " https://github.com/mikefarah/yq/releases/latest/download/yq_linux_$( dpkg --print-architecture) .tar.gz" \
860
+ wsh_download " https://github.com/mikefarah/yq/releases/latest/download/yq_linux_$( dpkg --print-architecture) .tar.gz" \
854
861
| tar -zxO > " ${BIN_PATH} /yq"
855
862
chmod +x " ${BIN_PATH} /yq"
856
863
;;
861
868
fi
862
869
exit ;;
863
870
871
+ upgrade)
872
+ BIN_PATH=${2:- " ${HOME} /bin" }
873
+ mkdir -p " ${BIN_PATH} "
874
+
875
+ wsh_download " https://github.com/asherikov/wshandler/releases/latest/download/wshandler" > " ${BIN_PATH} /wshandler"
876
+ chmod +x " ${BIN_PATH} /wshandler"
877
+ exit ;;
878
+
879
+ upgrade_appimage)
880
+ BIN_PATH=${2:- " ${HOME} /bin" }
881
+ mkdir -p " ${BIN_PATH} "
882
+
883
+ wsh_download " https://github.com/asherikov/wshandler/releases/latest/download/wshandler-$( uname -m) .AppImage" > " ${BIN_PATH} /wshandler"
884
+ chmod +x " ${BIN_PATH} /wshandler"
885
+ exit ;;
886
+
864
887
* )
865
888
help 1;;
866
889
esac
You can’t perform that action at this time.
0 commit comments