Skip to content

Commit

Permalink
Fix bug on macOS osascript when command has quotes
Browse files Browse the repository at this point in the history
Fixes #133
  • Loading branch information
franciscolourenco committed Sep 27, 2023
1 parent 932d3b5 commit 90eeefb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions conf.d/done.fish
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ if set -q __done_enabled
end

else if type -q osascript # AppleScript
# escape double quotes that might exist in the message and break osascript. fixes #133
set -l message (string replace --all '"' '\"' "$message")
set -l title (string replace --all '"' '\"' "$title")

osascript -e "display notification \"$message\" with title \"$title\""
if test "$__done_notify_sound" -eq 1
osascript -e "display notification \"$message\" with title \"$title\" sound name \"Glass\""
else
Expand Down

0 comments on commit 90eeefb

Please sign in to comment.