Biont / sway-launcher-desktop

TUI Application launcher with Desktop Entry support. Made for SwayWM, but runs anywhere
GNU General Public License v3.0
607 stars 28 forks source link

Support desktop files and commands containing single quotes #23

Closed thal closed 4 years ago

thal commented 4 years ago

This PR fixes an issue caused by filenames containing ' characters. For example, a file named Sid Meier's Civilization IV.desktop yields the following description:

╭────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ /usr/bin/sway-launcher-desktop: eval: line 59: unexpected EOF while looking for matching `''       │
│ /usr/bin/sway-launcher-desktop: eval: line 60: syntax error: unexpected end of file                │
│ /usr/bin/sway-launcher-desktop: Error on line 234: eval "${PROVIDER_ARGS[1]//\{1\}/${2}}"          │
╰────────────────────────────────────────────────────────────────────────────────────────────────────╯

This is fixed by wrapping the argument to describe-desktop in double quotes. This also applies to the 'command' provider and describe-command.

Biont commented 4 years ago

Thank you very much for contributing. Good catch!