chore: add install unstable script
All checks were successful
build and upload / build (push) Successful in 16s

This commit is contained in:
2025-05-02 15:52:37 +02:00
parent 733da9f7a0
commit 7f0159e72b
2 changed files with 34 additions and 1 deletions

View File

@@ -33,4 +33,10 @@ install:
install -d /usr/share/zsh/site-functions/ install -d /usr/share/zsh/site-functions/
install -m 644 completions.zsh /usr/share/zsh/site-functions/_$(APP_NAME) install -m 644 completions.zsh /usr/share/zsh/site-functions/_$(APP_NAME)
install -d /usr/share/fish/vendor_completions.d/ install -d /usr/share/fish/vendor_completions.d/
install -m 644 completions.fish /usr/share/fish/vendor_completions.d/$(APP_NAME).fish install -m 644 completions.fish /usr/share/fish/vendor_completions.d/$(APP_NAME).fish
uninstall:
rm -f $(PREFIX)/bin/$(APP_NAME)
rm -f /usr/share/bash-completion/completions/$(APP_NAME)
rm -f /usr/share/zsh/site-functions/_$(APP_NAME)
rm -f /usr/share/fish/vendor_completions.d/$(APP_NAME).fish

27
install_unstable.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
gitea_host="git.rawleenc.dev"
project_path="rawleenc/feddy"
command_name="feddy"
completion_files_and_paths=(
"$command_name/completions.bash:/usr/share/bash-completion/completions/$command_name"
"$command_name/completions.zsh:/usr/share/zsh/site-functions/_$command_name"
"$command_name/completions.fish:/usr/share/fish/vendor_completions.d/$command_name.fish"
)
url=$(curl -sS https://git.rawleenc.dev/api/v1/repos/$project_path/actions/tasks | jq -r '.workflow_runs[0].url')
curl -sS --output /tmp/$command_name.zip "$url/artifacts/$command_name"
unzip -o /tmp/$command_name.zip -d /tmp/$command_name
chmod +x /tmp/$command_name/target/release/$command_name
sudo mv /tmp/$command_name/target/release/$command_name /usr/local/bin/$command_name
for completion_file_and_path in "${completion_files_and_paths[@]}"; do
IFS=":" read -r completion_file completion_path <<< "$completion_file_and_path"
sudo mv "/tmp/$completion_file" "$completion_path"
sudo chmod +x "$completion_path"
done
rm -f $download_target