Skip to content

Commit 1054e90

Browse files
authored
Merge pull request #190 from DannyBen/add/bashly-version-to-script
Add bashly version to generated script header comment
2 parents 164e492 + 806d3e1 commit 1054e90

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env bash
2-
# This script was generated by bashly (https://github.com/DannyBen/bashly)
2+
# This script was generated by bashly <%= Bashly::VERSION %> (https://bashly.dannyb.co)
33
# Modifying it manually is not recommended
44

spec/approvals/cli/generate/wrap-script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# This script was generated by bashly (https://github.com/DannyBen/bashly)
2+
# This script was generated by bashly ... (https://bashly.dannyb.co)
33
# Modifying it manually is not recommended
44

55
# :script.wrapper

spec/approvals/script/wrapper/code

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# This script was generated by bashly (https://github.com/DannyBen/bashly)
2+
# This script was generated by bashly ... (https://bashly.dannyb.co)
33
# Modifying it manually is not recommended
44

55
# :script.bash3_bouncer

spec/approvals/script/wrapper/code-wrapped

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# This script was generated by bashly (https://github.com/DannyBen/bashly)
2+
# This script was generated by bashly ... (https://bashly.dannyb.co)
33
# Modifying it manually is not recommended
44

55
# :script.wrapper

spec/bashly/commands/generate_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
expect { subject.run %w[generate -w function] }.to output_approval('cli/generate/wrap-function')
8080
expect(File).to exist(cli_script)
8181
lines = File.readlines cli_script
82-
expect(lines[0..10].join).to match_approval('cli/generate/wrap-script')
82+
expect(lines[0..10].join).to match_approval('cli/generate/wrap-script').except(/\d+\.\d+\.\d+/)
8383
end
8484
end
8585

spec/bashly/script/wrapper_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
context "without function name" do
1111
it "returns the complete script" do
1212
lines = subject.code.split "\n"
13-
expect(lines[0..12].join("\n")).to match_approval('script/wrapper/code')
13+
expect(lines[0..12].join("\n")).to match_approval('script/wrapper/code').except(/\d+\.\d+\.\d+/)
1414
expect(lines[-1]).to eq 'run "$@"'
1515
end
1616
end
@@ -20,7 +20,7 @@
2020

2121
it "returns the complete script wrapped in a function without a bash3 bouncer" do
2222
lines = subject.code.split "\n"
23-
expect(lines[0..12].join("\n")).to match_approval('script/wrapper/code-wrapped')
23+
expect(lines[0..12].join("\n")).to match_approval('script/wrapper/code-wrapped').except(/\d+\.\d+\.\d+/)
2424
expect(lines[-1]).to eq '(return 0 2>/dev/null) || my_super_function "$@"'
2525
end
2626
end

0 commit comments

Comments
 (0)