Skip to content

Commit 8e5013b

Browse files
authored
Merge pull request #481 from DannyBen/remove/inspect-args-in-production
Avoid rendering `inspect_args()` when generating for production env
2 parents 6192a92 + 10899cf commit 8e5013b

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
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/approvals/cli/generate/help

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ Options:
2323
-e --env ENV
2424
Force the generation environment:
2525

26-
- production generate a smaller script, without file markers
27-
- development generate with file markers
26+
- development default script output
27+
- production remove file marker comments and development functions
2828

2929
-h --help
3030
Show this help

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)