diff options
| -rwxr-xr-x | sway-launcher-desktop.sh | 2 | ||||
| -rw-r--r-- | tests/generate-command.bats | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/sway-launcher-desktop.sh b/sway-launcher-desktop.sh index cf6b359..4f59666 100755 --- a/sway-launcher-desktop.sh +++ b/sway-launcher-desktop.sh @@ -108,7 +108,7 @@ if [[ "$1" == 'generate-command' ]]; then END{ if(path){ - printf "cd " path " &&" + printf "cd " path " && " } if (terminal){ printf terminal_command " " diff --git a/tests/generate-command.bats b/tests/generate-command.bats index 780c963..f078946 100644 --- a/tests/generate-command.bats +++ b/tests/generate-command.bats @@ -2,4 +2,16 @@ run ../sway-launcher-desktop.sh generate-command data/firefox.desktop [ "$status" -eq 0 ] [[ "$output" == '/usr/lib/firefox/firefox' ]] +} + +@test "Exec command is properly generated from htop desktop file" { + run ../sway-launcher-desktop.sh generate-command data/htop.desktop + [ "$status" -eq 0 ] + [[ "$output" == 'termite -e htop' ]] +} + +@test "Exec command is properly generated from minecraft-launcher desktop file" { + run ../sway-launcher-desktop.sh generate-command data/minecraft-launcher.desktop + [ "$status" -eq 0 ] + [[ "$output" == 'cd /opt/minecraft-launcher/ && env GDK_BACKEND=x11 /opt/minecraft-launcher/minecraft-launcher' ]] }
\ No newline at end of file |
