-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from sargsyan/eliminate-globbing-and-splitting-…
…issues eliminate globbing and splitting from libraries used for notifications service
- Loading branch information
Showing
5 changed files
with
21 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
#!/bin/bash | ||
|
||
readonly LIB_DIR_NAME=$(dirname $BASH_SOURCE) | ||
readonly LIB_DIR_NAME=$(dirname "$BASH_SOURCE") | ||
readonly EMOJIFY=$([ -x "$(command -v emojify)" ] && echo emojify || echo cat) | ||
TERMINAL_NOTIFIER=$LIB_DIR_NAME/../github-notifier.app/Contents/MacOS/terminal-notifier | ||
|
||
function show_notification_window() { | ||
local title=$(echo $1 | $EMOJIFY) | ||
local subtitle=$(echo $2 | $EMOJIFY) | ||
local message=$(echo $3 | $EMOJIFY) | ||
local title=$(echo "$1" | $EMOJIFY) | ||
local subtitle=$(echo "$2" | $EMOJIFY) | ||
local message=$(echo "$3" | $EMOJIFY) | ||
local link=$4 | ||
local icon=$5 | ||
|
||
#remove '[' and '<' characters from begining of the strings | ||
#because of https://github.com/julienXX/terminal-notifier/issues/134 | ||
local title=$(echo $title | sed 's|^\[\(.*\)\]|\1|' | sed -E 's|^[\[\<]+||') | ||
local message=$(echo $message | sed 's|^\[\(.*\)\]|\1|' | sed -E 's|^[\[\<]+||') | ||
local title=$(echo "$title" | sed 's|^\[\(.*\)\]|\1|' | sed -E 's|^[\[\<]+||') | ||
local message=$(echo "$message" | sed 's|^\[\(.*\)\]|\1|' | sed -E 's|^[\[\<]+||') | ||
|
||
$TERMINAL_NOTIFIER --group 1 -title "$title" -subtitle "$subtitle" -message "$message" -open $link -appIcon $icon | ||
$TERMINAL_NOTIFIER --group 1 -title "$title" -subtitle "$subtitle" -message "$message" -open "$link" -appIcon "$icon" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters