Skip to content

Commit c470a49

Browse files
committed
Adds multiline support for description of issues
1 parent cb864c7 commit c470a49

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
linear-cli (0.5.2)
4+
linear-cli (0.5.3)
55
base64 (~> 0.2)
66
dry-cli (~> 1.0)
77
dry-cli-completion (~> 1.0)

lib/linear/api.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,13 @@ def call(body)
4141
end
4242

4343
def query(query)
44-
call format('{ "query": "%s" }', query.to_s.gsub("\n", '').gsub('"', '\"'))
44+
call format('{ "query": %s }', query.to_s.to_json)
45+
rescue StandardError => e
46+
logger.error('Error in query', query:, error: e)
47+
raise e unless Rubyists::Linear.verbosity > 2
48+
49+
require 'pry'
50+
binding.pry # rubocop:disable Lint/Debugger
4551
end
4652

4753
def api_key
@@ -51,6 +57,7 @@ def api_key
5157
@api_key = ENV.fetch('LINEAR_API_KEY')
5258
end
5359
end
60+
# Acts as a singleton for a GraphApi instance
5461
Api = Rubyists::Linear::GraphApi.new
5562
end
5663
end

lib/linear/cli/sub_commands.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def team_for(key = nil)
5050
def description_for(description = nil)
5151
return description if description
5252

53-
prompt.multiline('Description:').join(' ')
53+
prompt.multiline('Description:').map(&:chomp).join('\\n')
5454
end
5555

5656
def title_for(title = nil)

0 commit comments

Comments
 (0)