summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Makhov <pmakhov@theoctavegroup.com>2019-11-08 14:30:20 -0500
committerPavel Makhov <pmakhov@theoctavegroup.com>2019-11-08 14:30:47 -0500
commit85ed393e634fb76daf141ec87b92181b1b8e3316 (patch)
tree1821c45085cd9491dd19d26ab4377a9e0c5447ad
parentbf136f9d14b48dde2db4e66e4beb49e29e8060a2 (diff)
Put url in quotes to reduce number of characters to escape
-rw-r--r--jira-widget/jira.lua10
1 files changed, 4 insertions, 6 deletions
diff --git a/jira-widget/jira.lua b/jira-widget/jira.lua
index d60aa77..54727ae 100644
--- a/jira-widget/jira.lua
+++ b/jira-widget/jira.lua
@@ -21,7 +21,7 @@ local gs = require("gears.string")
local HOME_DIR = os.getenv("HOME")
-local GET_ISSUES_CMD = [[bash -c "curl -s -X GET -n %s/rest/api/2/search?%s"]]
+local GET_ISSUES_CMD = [[bash -c "curl -s -X GET -n '%s/rest/api/2/search?%s'"]]
local DOWNLOAD_AVATAR_CMD = [[bash -c "curl -n --create-dirs -o %s/.cache/awmw/jira-widget/avatars/%s %s"]]
local jira_widget = {}
@@ -31,8 +31,8 @@ local function worker(args)
local args = args or {}
local icon = args.icon or HOME_DIR .. '/.config/awesome/awesome-wm-widgets/jira-widget/jira-mark-gradient-blue.svg'
- local host = args.host or naughty.notify{preset = naughty.config.presets.critical, text = 'Gerrit host is unknown'}
- local query = args.query or 'jql=assignee=currentuser()+AND+resolution=Unresolved'
+ local host = args.host or naughty.notify{preset = naughty.config.presets.critical, text = 'Jira host is unknown'}
+ local query = args.query or 'jql=assignee=currentuser() AND resolution=Unresolved'
local current_number_of_reviews
local previous_number_of_reviews = 0
@@ -192,9 +192,7 @@ local function worker(args)
-- text = string.format(GET_ISSUES_CMD, host, query:gsub(" ", "+")),
-- run = function() spawn.with_shell("echo '" .. string.format(GET_ISSUES_CMD, host, query:gsub(" ", "+")) .. "' | xclip -selection clipboard") end
--}
- watch(string.format(GET_ISSUES_CMD, host, query:gsub(' ', '+')
- :gsub('%(', '\\(')
- :gsub('%)', '\\)')),
+ watch(string.format(GET_ISSUES_CMD, host, query:gsub(' ', '+')),
10, update_widget, jira_widget)
return jira_widget
end