12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/space_architect/bug_report.rb', line 12
def generate(space: nil, env: ENV, cwd: Dir.pwd, now: Time.now, title: nil)
body_path = resolve_body_path(space, cwd, now)
FileUtils.mkdir_p(body_path.dirname)
body = build_body(space, title)
body_path.write(body)
contracted = Space::Core::Paths.contract(body_path, env: env)
title_flag = blank_title?(title) ? "" : " --title #{quote_title(title)}"
command = Space::Core::Commands.wrap(
%(gh issue create -R #{REPO}#{title_flag} --body-file #{contracted})
)
{ body_path: body_path, command: command, body: body }
end
|