Skip to content

Commit 63eac42

Browse files
committed
normalize mode condition
1 parent c5a877e commit 63eac42

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/completely/commands/generate.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ def run
4141

4242
if args['--install']
4343
install output
44+
elsif output_path == '-'
45+
show output
4446
else
45-
show_or_save output
47+
save output
4648
end
4749
end
4850

@@ -56,13 +58,11 @@ def install(content)
5658
say 'You may need to restart your session to test it'
5759
end
5860

59-
def show_or_save(content)
60-
if output_path == '-'
61-
puts content
62-
else
63-
File.write output_path, content
64-
say "Saved m`#{output_path}`"
65-
end
61+
def show(content) = puts content
62+
63+
def save(content)
64+
File.write output_path, content
65+
say "Saved m`#{output_path}`"
6666
syntax_warning unless completions.valid?
6767
end
6868

0 commit comments

Comments
 (0)