Skip to content

Commit dbb8816

Browse files
committed
- Avoid rendering inspect_args() when generating for production env
1 parent 6192a92 commit dbb8816

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

lib/bashly/commands/generate.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class Generate < Base
1616
option '-e --env ENV', <<~HELP
1717
Force the generation environment:
1818
19-
- production generate a smaller script, without file markers
20-
- development generate with file markers
19+
- development default script output
20+
- production remove file marker comments and development functions
2121
HELP
2222

2323
example 'bashly generate --force'

lib/bashly/views/command/master_script.gtx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
= render :version_command
55
= render :usage
66
= render :normalize_input
7-
= render :inspect_args
7+
= render :inspect_args unless Settings.production?
88
= render :user_lib if user_lib.any?
99
= render :command_functions
1010
= render :parse_requirements

spec/bashly/commands/generate_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@
2828
before { Settings.env = :production }
2929
after { Settings.env = nil }
3030

31-
it 'generates a script without view markers' do
31+
it 'generates a script without view markers or inspect_args function' do
3232
expect { subject.execute %w[generate] }.to output_approval('cli/generate/production-env-var')
3333
expect(File).to exist(cli_script)
3434
expect(cli_script_content).not_to include '# :'
35+
expect(cli_script_content).not_to include 'inspect_args()'
3536
end
3637
end
3738

0 commit comments

Comments
 (0)