Skip to content

Commit db7bfc8

Browse files
committed
add partials_extension spec
1 parent a0f4cd5 commit db7bfc8

File tree

8 files changed

+1074
-0
lines changed

8 files changed

+1074
-0
lines changed
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
+ export BASHLY_PARTIALS_EXTENSION=bash
2+
+ BASHLY_PARTIALS_EXTENSION=bash
3+
+ bundle exec bashly init
4+
created src/bashly.yml
5+
run bashly generate to create the bash script
6+
+ bundle exec bashly generate
7+
creating user files in src
8+
created src/initialize.bash
9+
created src/download_command.bash
10+
created src/upload_command.bash
11+
created ./cli
12+
run ./cli --help to test your bash script
13+
+ bundle exec bashly add colors
14+
created src/lib/colors.bash
15+
+ bundle exec bashly add comp function
16+
created src/lib/send_completions.bash
17+
18+
In order to enable completions in your script, create a command or a flag (for example: cli completions or cli --completions) that calls the send_completions function.
19+
20+
Your users can then run something like this to enable completions:
21+
22+
$ eval "$(cli completions)"
23+
24+
+ bundle exec bashly add config
25+
created src/lib/config.bash
26+
+ bundle exec bashly add help
27+
created src/help_command.bash
28+
29+
Add this as a command to your bashly.yml:
30+
31+
commands:
32+
- name: help
33+
help: Show help about a command
34+
args:
35+
- name: command
36+
help: Help subject
37+
38+
39+
+ bundle exec bashly add lib
40+
created src/lib/sample_function.bash
41+
+ bundle exec bashly add validations
42+
created src/lib/validations/validate_dir_exists.bash
43+
created src/lib/validations/validate_file_exists.bash
44+
created src/lib/validations/validate_integer.bash
45+
created src/lib/validations/validate_not_empty.bash
46+
+ bundle exec bashly add yaml
47+
created src/lib/yaml.bash
48+
+ bundle exec bashly generate --upgrade
49+
creating user files in src
50+
skipped src/initialize.bash (exists)
51+
skipped src/download_command.bash (exists)
52+
skipped src/upload_command.bash (exists)
53+
updated src/help_command.bash
54+
updated src/lib/colors.bash
55+
updated src/lib/config.bash
56+
updated src/lib/send_completions.bash
57+
updated src/lib/validations/validate_dir_exists.bash
58+
updated src/lib/validations/validate_file_exists.bash
59+
updated src/lib/validations/validate_integer.bash
60+
updated src/lib/validations/validate_not_empty.bash
61+
updated src/lib/yaml.bash
62+
created ./cli
63+
run ./cli --help to test your bash script
64+
+ ./cli
65+
cli - Sample application
66+
67+
Usage:
68+
cli COMMAND
69+
cli [COMMAND] --help | -h
70+
cli --version | -v
71+
72+
Commands:
73+
download Download a file
74+
upload Upload a file
75+
76+
+ ./cli --help
77+
cli - Sample application
78+
79+
Usage:
80+
cli COMMAND
81+
cli [COMMAND] --help | -h
82+
cli --version | -v
83+
84+
Commands:
85+
download Download a file
86+
upload Upload a file
87+
88+
Options:
89+
--help, -h
90+
Show this help
91+
92+
--version, -v
93+
Show version number
94+
95+
Environment Variables:
96+
API_KEY
97+
Set your API key
98+
99+
+ ./cli download something
100+
# this file is located in 'src/download_command.bash'
101+
# code for 'cli download' goes here
102+
# you can edit it freely and regenerate (it will not be overwritten)
103+
args:
104+
- ${args[source]} = something
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This fixture tests that changing the setting partials_extension to bash
2+
applies the desired extension to all generated files.

0 commit comments

Comments
 (0)