Fix some issues

This commit is contained in:
Tobias Reisinger 2024-10-01 00:20:08 +02:00
parent b827471e6d
commit fb1e41ddc4
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
4 changed files with 10 additions and 15 deletions

View file

@ -16,17 +16,9 @@ jobs:
source "$HOME/.cargo/env" source "$HOME/.cargo/env"
cargo build --release cargo build --release
shell: bash shell: bash
- uses: https://code.forgejo.org/actions/upload-artifact@v3
with:
name: teamspeak-query-lib
path: ${{ github.workspace }}/target/release/teamspeak-query-lib
- uses: https://code.forgejo.org/actions/download-artifact@v3
with:
name: teamspeak-query-lib
path: /tmp/artifacts
shell: bash
- id: copy-ts-control-artificat - id: copy-ts-control-artificat
run: | run: |
cp ${{ github.workspace }}/target/release/teamspeak-query-lib /tmp/artifacts
cp ${{ github.workspace }}/ts-control /tmp/artifacts cp ${{ github.workspace }}/ts-control /tmp/artifacts
shell: bash shell: bash
- uses: https://code.forgejo.org/actions/forgejo-release@v1 - uses: https://code.forgejo.org/actions/forgejo-release@v1

2
Cargo.lock generated
View file

@ -182,7 +182,7 @@ dependencies = [
[[package]] [[package]]
name = "teamspeak-query-lib" name = "teamspeak-query-lib"
version = "0.1.5" version = "0.1.6"
dependencies = [ dependencies = [
"clap", "clap",
"serde", "serde",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "teamspeak-query-lib" name = "teamspeak-query-lib"
version = "0.1.5" version = "0.1.6"
edition = "2021" edition = "2021"
[dependencies] [dependencies]

View file

@ -46,12 +46,16 @@ _ts_control_fetch() {
} }
_ts_control_single_or_dmenu() { _ts_control_single_or_dmenu() {
options=$(echo "$1" | grep "$2") filter="$2"
if [ "$filter" == "^$" ]; then
filter=""
fi
options=$(echo "$1" | grep "$filter")
count=$(echo "$options" | wc -l) count=$(echo "$options" | wc -l)
if [ "$count" -eq 1 ]; then if [ "$count" -eq 1 ]; then
echo "$options" echo "$options"
else else
echo "$options" | $DMENU echo "$1" | $DMENU
fi fi
} }
@ -90,8 +94,7 @@ handle_ntfy_events() {
done done
} }
# Add '$' to $1 to add 'End of line' to the regex for grep action=$(_ts_control_single_or_dmenu "$actions" "^$1$")
action=$(_ts_control_single_or_dmenu "$actions" "$1$")
case $action in case $action in
"quick") "quick")