Commit 352b7e9 1 parent 5c03e13 commit 352b7e9 Copy full SHA for 352b7e9
File tree 2 files changed +31
-5
lines changed
2 files changed +31
-5
lines changed Original file line number Diff line number Diff line change 26
26
- uses : actions/checkout@v4
27
27
- run : ./wshandler install_test_deps
28
28
- run : sudo ./wshandler --policy download install /usr/bin/
29
+ - run : sudo ./wshandler upgrade /usr/bin/
29
30
- run : make test WSHANDLER=wshandler
30
31
31
32
ubuntu22-snap-yq :
34
35
- uses : actions/checkout@v4
35
36
- run : ./wshandler install_test_deps
36
37
- run : sudo ./wshandler --policy snap install /usr/bin/
38
+ - run : sudo ./wshandler upgrade /usr/bin/
37
39
- run : make test WSHANDLER=wshandler
38
40
39
41
appimage :
44
46
- run : make appimage ARCH=x86_64 YQ_ARCH=amd64 WSHANDLER_VERSION=1.1.1
45
47
- run : make appimage ARCH=aarch64 YQ_ARCH=arm64
46
48
- run : make test WSHANDLER=./build/appimage/wshandler-x86_64.AppImage
49
+ - run : ./build/appimage/wshandler-x86_64.AppImage upgrade_appimage
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