bashly 1.2.7 → 1.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa7187087fc2f921c6631e901db4a6a1e4af476e870bd272b4fa11c1f6650a29
4
- data.tar.gz: 33dc09b9df4a807cb1fdae1538eced45214e5d029f25b8ed4ca40c2760210fb8
3
+ metadata.gz: 835cd138c47f6519a1fc6ca21c5dfc4b3a9b276e8ea8d082104d7206cc1ed75e
4
+ data.tar.gz: 8688035834ceb891b28cc6b22f6f9a9a215332a674e5f900e89339862e49d993
5
5
  SHA512:
6
- metadata.gz: 44d91f1ab44daa047bf40d2a22c4e422cdba92d884bfb27bed4e6749156b66fdd6fd54465a64f72a3c18bf5fa691daca3d60ead18b91e22e94096c38f655dbed
7
- data.tar.gz: 00d6f327d759e79ec2856858f3f3a8db16ce91fa0eaa87d1336870b1ae3e776d70069d33c4dc2c6afe8c0544fadadd7401111463fde0f69ac6f6c507ae537289
6
+ metadata.gz: b01a2ece1903bafb37e2dcf8fd28797272ec99e226484e34bf8a4927aa9368cef31a6f21a89cc51b807d5ba3da53eaaf83fb0683a929a5e43de07899334e82c6
7
+ data.tar.gz: 47a1aa8c24dba99340d98f3f348b1aa24b4c2907ba6ffd37968ce6b4aa54c74dca75057397d1ba58c73934e49b63aad20a3f62b3d1e228af903fe90a8ddf6f97
data/README.md CHANGED
@@ -9,7 +9,7 @@ Create feature-rich bash scripts using simple YAML configuration
9
9
  [![Build Status](https://github.com/DannyBen/bashly/workflows/Test/badge.svg)](https://github.com/DannyBen/bashly/actions?query=workflow%3ATest)
10
10
  [![Maintainability](https://api.codeclimate.com/v1/badges/8cf89047e50ca601e431/maintainability)](https://codeclimate.com/github/DannyBen/bashly/maintainability)
11
11
 
12
- ## [bashly.dannyb.co](https://bashly.dannyb.co)
12
+ ## [bashly.dev](https://bashly.dev)
13
13
 
14
14
  ---
15
15
 
@@ -76,6 +76,6 @@ Visit the *[How to contribute][contributing]* page for more information.
76
76
 
77
77
  [issues]: https://github.com/DannyBen/bashly/issues
78
78
  [discussions]: https://github.com/DannyBen/bashly/discussions
79
- [docs]: https://bashly.dannyb.co/
79
+ [docs]: https://bashly.dev/
80
80
  [examples]: https://github.com/DannyBen/bashly/tree/master/examples#bashly-examples
81
81
  [contributing]: https://github.com/DannyBen/bashly/blob/master/CONTRIBUTING.md#how-to-contribute
data/lib/bashly/cli.rb CHANGED
@@ -7,7 +7,7 @@ module Bashly
7
7
  def self.runner
8
8
  runner = MisterBin::Runner.new version: Bashly::VERSION,
9
9
  header: 'Bashly - Bash CLI Generator',
10
- footer: "Help: m`bashly COMMAND --help`\nDocs: bu`https://bashly.dannyb.co`"
10
+ footer: "Help: m`bashly COMMAND --help`\nDocs: bu`https://bashly.dev`"
11
11
 
12
12
  runner.route 'init', to: Commands::Init
13
13
  runner.route 'preview', to: Commands::Preview
@@ -3,7 +3,7 @@ module Bashly
3
3
  class Add < Base
4
4
  help 'Add extra features and customization to your script'
5
5
 
6
- usage 'bashly add [--source NAME] LIBRARY [ARGS...] [--force]'
6
+ usage 'bashly add [--source NAME] LIBRARY [ARGS...] [--force --quiet]'
7
7
  usage 'bashly add [--source NAME] --list'
8
8
  usage 'bashly add (-h|--help)'
9
9
 
@@ -17,6 +17,7 @@ module Bashly
17
17
  USAGE
18
18
  option '-f --force', 'Overwrite existing files'
19
19
  option '-l --list', 'Show available libraries'
20
+ option '-q --quiet', 'Do not show post-install messages'
20
21
 
21
22
  attr_reader :skip_src_check
22
23
 
@@ -70,7 +71,9 @@ module Bashly
70
71
  end
71
72
 
72
73
  message = library.post_install_message
73
- say "\n#{message}" if message && files_created.positive?
74
+ return if !message || files_created.zero? || args['--quiet']
75
+
76
+ say "\n#{message}"
74
77
  end
75
78
 
76
79
  def safe_write(path, content)
@@ -1,6 +1,6 @@
1
1
  arg:
2
2
  help: Define positional arguments.
3
- url: https://bashly.dannyb.co/configuration/argument/
3
+ url: https://bashly.dev/configuration/argument/
4
4
  example: |-
5
5
  args:
6
6
  - name: user
@@ -16,7 +16,7 @@ arg:
16
16
 
17
17
  arg.allowed:
18
18
  help: Specify a list of allowed values. Can be used in conjunction with `default` and `required`.
19
- url: https://bashly.dannyb.co/configuration/argument/#allowed
19
+ url: https://bashly.dev/configuration/argument/#allowed
20
20
  example: |-
21
21
  args:
22
22
  - name: region
@@ -35,7 +35,7 @@ arg.allowed:
35
35
 
36
36
  arg.default:
37
37
  help: Specify the value to apply when not provided by the user.
38
- url: https://bashly.dannyb.co/configuration/argument/#default
38
+ url: https://bashly.dev/configuration/argument/#default
39
39
  example: |-
40
40
  args:
41
41
  - name: images
@@ -44,7 +44,7 @@ arg.default:
44
44
 
45
45
  arg.help:
46
46
  help: Specify the help message for this argument.
47
- url: https://bashly.dannyb.co/configuration/argument/#help
47
+ url: https://bashly.dev/configuration/argument/#help
48
48
  example: |-
49
49
  args:
50
50
  - name: user
@@ -53,7 +53,7 @@ arg.help:
53
53
 
54
54
  arg.name:
55
55
  help: Specify the lowercase name of the argument.
56
- url: https://bashly.dannyb.co/configuration/argument/#name
56
+ url: https://bashly.dev/configuration/argument/#name
57
57
  example: |-
58
58
  args:
59
59
  - name: user
@@ -67,7 +67,7 @@ arg.repeatable:
67
67
  The argument below will be received as a space-delimited string which needs to be converted to an array with:
68
68
  `eval "data=(${args[file]})"`
69
69
 
70
- url: https://bashly.dannyb.co/configuration/argument/#repeatable
70
+ url: https://bashly.dev/configuration/argument/#repeatable
71
71
  example: |-
72
72
  args:
73
73
  - name: file
@@ -77,7 +77,7 @@ arg.repeatable:
77
77
 
78
78
  arg.required:
79
79
  help: Specify that this argument is required.
80
- url: https://bashly.dannyb.co/configuration/argument/#required
80
+ url: https://bashly.dev/configuration/argument/#required
81
81
  example: |-
82
82
  args:
83
83
  - name: region
@@ -87,7 +87,7 @@ arg.required:
87
87
  arg.validate:
88
88
  help: Apply custom validation functions.
89
89
 
90
- url: https://bashly.dannyb.co/configuration/argument/#validate
90
+ url: https://bashly.dev/configuration/argument/#validate
91
91
  example: |-
92
92
  args:
93
93
  - name: path
@@ -1,6 +1,6 @@
1
1
  command:
2
2
  help: Define the root command, or any sub-command.
3
- url: https://bashly.dannyb.co/configuration/command/
3
+ url: https://bashly.dev/configuration/command/
4
4
  example: |-
5
5
  name: rush
6
6
  help: Personal package manager
@@ -17,7 +17,7 @@ command:
17
17
 
18
18
  command.alias:
19
19
  help: Specify one or more aliases for this sub-command.
20
- url: https://bashly.dannyb.co/configuration/command/#alias
20
+ url: https://bashly.dev/configuration/command/#alias
21
21
  example: |-
22
22
  # Define a single alias
23
23
  command:
@@ -36,7 +36,7 @@ command.alias:
36
36
 
37
37
  command.args:
38
38
  help: Define a list of positional arguments. See `arg` for reference.
39
- url: https://bashly.dannyb.co/configuration/command/#args
39
+ url: https://bashly.dev/configuration/command/#args
40
40
  example: |-
41
41
  args:
42
42
  - name: repo
@@ -45,7 +45,7 @@ command.args:
45
45
 
46
46
  command.catch_all:
47
47
  help: Specify that this command should allow for additional arbitrary arguments or flags.
48
- url: https://bashly.dannyb.co/configuration/command/#catch_all
48
+ url: https://bashly.dev/configuration/command/#catch_all
49
49
  example: |-
50
50
  commands:
51
51
  - name: download
@@ -67,7 +67,7 @@ command.catch_all:
67
67
 
68
68
  command.commands:
69
69
  help: Define a list of sub-commands. See `command` for reference.
70
- url: https://bashly.dannyb.co/configuration/command/#commands
70
+ url: https://bashly.dev/configuration/command/#commands
71
71
  example: |-
72
72
  commands:
73
73
  - name: add
@@ -76,7 +76,7 @@ command.commands:
76
76
 
77
77
  command.completions:
78
78
  help: Specify a list of additional completion suggestions when used in conjunction with `bashly add completions`.
79
- url: https://bashly.dannyb.co/configuration/command/#completions
79
+ url: https://bashly.dev/configuration/command/#completions
80
80
  example: |-
81
81
  commands:
82
82
  - name: view
@@ -88,7 +88,7 @@ command.completions:
88
88
 
89
89
  command.default:
90
90
  help: Specify that this sub-command will be executed implicitly.
91
- url: https://bashly.dannyb.co/configuration/command/#default
91
+ url: https://bashly.dev/configuration/command/#default
92
92
  example: |-
93
93
  # This command will execute when the command line is not
94
94
  # recognized.
@@ -106,7 +106,7 @@ command.default:
106
106
 
107
107
  command.dependencies:
108
108
  help: Specify a list of required external commands that are needed to run this command.
109
- url: https://bashly.dannyb.co/configuration/command/#dependencies
109
+ url: https://bashly.dev/configuration/command/#dependencies
110
110
  example: |-
111
111
  # Array syntax
112
112
  dependencies:
@@ -128,7 +128,7 @@ command.dependencies:
128
128
 
129
129
  command.environment_variables:
130
130
  help: Define a list of environment variables. See `environment_variable` for reference.
131
- url: https://bashly.dannyb.co/configuration/command/#environment_variables
131
+ url: https://bashly.dev/configuration/command/#environment_variables
132
132
  example: |-
133
133
  environment_variables:
134
134
  - name: config_path
@@ -140,7 +140,7 @@ command.environment_variables:
140
140
 
141
141
  command.examples:
142
142
  help: Define one or more example messages.
143
- url: https://bashly.dannyb.co/configuration/command/#examples
143
+ url: https://bashly.dev/configuration/command/#examples
144
144
  example: |-
145
145
  # Use an array of examples for simple one-liners.
146
146
  examples:
@@ -159,7 +159,7 @@ command.examples:
159
159
 
160
160
  command.expose:
161
161
  help: Specify that the sub-commands of this command should be visible when showing the usage of its parent.
162
- url: https://bashly.dannyb.co/configuration/command/#expose
162
+ url: https://bashly.dev/configuration/command/#expose
163
163
  example: |-
164
164
  name: cli
165
165
  commands:
@@ -190,7 +190,7 @@ command.expose:
190
190
 
191
191
  command.extensible:
192
192
  help: Specify that this command can be extended by external means.
193
- url: https://bashly.dannyb.co/configuration/command/#extensible
193
+ url: https://bashly.dev/configuration/command/#extensible
194
194
  example: |-
195
195
  name: mygit
196
196
  help: Wrapper for git
@@ -206,7 +206,7 @@ command.extensible:
206
206
 
207
207
  command.filename:
208
208
  help: Specify the path (relative to src) to the partial source code file.
209
- url: https://bashly.dannyb.co/configuration/command/#filename
209
+ url: https://bashly.dev/configuration/command/#filename
210
210
  example: |-
211
211
  commands:
212
212
  - name: connect
@@ -215,7 +215,7 @@ command.filename:
215
215
 
216
216
  command.filters:
217
217
  help: Specify a list of custom filter functions that will prevent the command from running unless certain conditions are met.
218
- url: https://bashly.dannyb.co/configuration/command/#filters
218
+ url: https://bashly.dev/configuration/command/#filters
219
219
  example: |-
220
220
  commands:
221
221
  - name: container
@@ -235,7 +235,7 @@ command.filters:
235
235
 
236
236
  command.flags:
237
237
  help: Define a list of option flags. See `flag` for reference.
238
- url: https://bashly.dannyb.co/configuration/command/#flags
238
+ url: https://bashly.dev/configuration/command/#flags
239
239
  example: |-
240
240
  flags:
241
241
  - long: --purge
@@ -244,13 +244,13 @@ command.flags:
244
244
 
245
245
  command.footer:
246
246
  help: Specify a message to show at the bottom of the help text.
247
- url: https://bashly.dannyb.co/configuration/command/#footer
247
+ url: https://bashly.dev/configuration/command/#footer
248
248
  example: |-
249
249
  footer: For further help visit https://my.docs-site.com
250
250
 
251
251
  command.function:
252
252
  help: Specify a different base function name for this command.
253
- url: https://bashly.dannyb.co/configuration/command/#function
253
+ url: https://bashly.dev/configuration/command/#function
254
254
  example: |-
255
255
  commands:
256
256
  - name: container-start
@@ -271,7 +271,7 @@ command.function:
271
271
 
272
272
  command.group:
273
273
  help: Specify the group that this command belongs to.
274
- url: https://bashly.dannyb.co/configuration/command/#group
274
+ url: https://bashly.dev/configuration/command/#group
275
275
  example: |-
276
276
  command:
277
277
  name: start
@@ -280,7 +280,7 @@ command.group:
280
280
 
281
281
  command.help:
282
282
  help: Specify the help text to show when displaying usage.
283
- url: https://bashly.dannyb.co/configuration/command/#help
283
+ url: https://bashly.dev/configuration/command/#help
284
284
  example: |-
285
285
  name: docker
286
286
  help: Runtime for containers
@@ -291,7 +291,7 @@ command.help:
291
291
 
292
292
  command.name:
293
293
  help: Specify the name of the command. This option is required.
294
- url: https://bashly.dannyb.co/configuration/command/#name
294
+ url: https://bashly.dev/configuration/command/#name
295
295
  example: |-
296
296
  name: docker
297
297
  help: Runtime for containers
@@ -302,7 +302,7 @@ command.name:
302
302
 
303
303
  command.private:
304
304
  help: Specify that this command should not be displayed in the help text.
305
- url: https://bashly.dannyb.co/configuration/command/#private
305
+ url: https://bashly.dev/configuration/command/#private
306
306
  example: |-
307
307
  commands:
308
308
  - name: completions
@@ -311,7 +311,7 @@ command.private:
311
311
 
312
312
  command.variables:
313
313
  help: Define a list of global bash variables. See `variable` for reference.
314
- url: https://bashly.dannyb.co/configuration/command/#variables
314
+ url: https://bashly.dev/configuration/command/#variables
315
315
  example: |-
316
316
  variables:
317
317
  # Simple value
@@ -332,7 +332,7 @@ command.variables:
332
332
 
333
333
  command.version:
334
334
  help: Specify the version to show when running with `--version`.
335
- url: https://bashly.dannyb.co/configuration/command/#version
335
+ url: https://bashly.dev/configuration/command/#version
336
336
  example: |-
337
337
  name: rush
338
338
  help: Personal package manager
@@ -1,6 +1,6 @@
1
1
  environment_variable:
2
2
  help: Define environment variables that will be in use in your script.
3
- url: https://bashly.dannyb.co/configuration/environment-variable/
3
+ url: https://bashly.dev/configuration/environment-variable/
4
4
  example: |-
5
5
  environment_variables:
6
6
  - name: config_path
@@ -12,7 +12,7 @@ environment_variable:
12
12
 
13
13
  environment_variable.default:
14
14
  help: Specify the value to apply when not provided by the user.
15
- url: https://bashly.dannyb.co/configuration/environment-variable/#default
15
+ url: https://bashly.dev/configuration/environment-variable/#default
16
16
  example: |-
17
17
  environment_variables:
18
18
  - name: config_path
@@ -21,7 +21,7 @@ environment_variable.default:
21
21
 
22
22
  environment_variable.help:
23
23
  help: Specify the help message for this variable.
24
- url: https://bashly.dannyb.co/configuration/environment-variable/#help
24
+ url: https://bashly.dev/configuration/environment-variable/#help
25
25
  example: |-
26
26
  environment_variables:
27
27
  - name: api_key
@@ -29,7 +29,7 @@ environment_variable.help:
29
29
 
30
30
  environment_variable.name:
31
31
  help: Specify the lowercase name of the variable.
32
- url: https://bashly.dannyb.co/configuration/environment-variable/#name
32
+ url: https://bashly.dev/configuration/environment-variable/#name
33
33
  example: |-
34
34
  environment_variables:
35
35
  - name: api_key
@@ -37,7 +37,7 @@ environment_variable.name:
37
37
 
38
38
  environment_variable.private:
39
39
  help: Specify that this environment variable should not be advertised in the usage text.
40
- url: https://bashly.dannyb.co/configuration/environment-variable/#private
40
+ url: https://bashly.dev/configuration/environment-variable/#private
41
41
  example: |-
42
42
  environment_variables:
43
43
  - name: editor
@@ -47,7 +47,7 @@ environment_variable.private:
47
47
 
48
48
  environment_variable.required:
49
49
  help: Specify that this variable is required.
50
- url: https://bashly.dannyb.co/configuration/environment-variable/#required
50
+ url: https://bashly.dev/configuration/environment-variable/#required
51
51
  example: |-
52
52
  environment_variables:
53
53
  - name: api_key
@@ -57,7 +57,7 @@ environment_variable.required:
57
57
  environment_variable.validate:
58
58
  help: Apply custom validation functions.
59
59
 
60
- url: https://bashly.dannyb.co/configuration/environment-variable/#validate
60
+ url: https://bashly.dev/configuration/environment-variable/#validate
61
61
  example: |-
62
62
  environment_variables:
63
63
  - name: build_dir
@@ -1,6 +1,6 @@
1
1
  flag:
2
2
  help: Define option flags.
3
- url: https://bashly.dannyb.co/configuration/flag/
3
+ url: https://bashly.dev/configuration/flag/
4
4
  example: |-
5
5
  flags:
6
6
  - long: --ssh
@@ -15,7 +15,7 @@ flag:
15
15
 
16
16
  flag.allowed:
17
17
  help: Specify a list of allowed values. Can be used in conjunction with `default` and `required`, and must be accompanied by `arg`.
18
- url: https://bashly.dannyb.co/configuration/flag/#allowed
18
+ url: https://bashly.dev/configuration/flag/#allowed
19
19
  example: |-
20
20
  flags:
21
21
  - long: --user
@@ -38,7 +38,7 @@ flag.allowed:
38
38
 
39
39
  flag.arg:
40
40
  help: Specify the name of the argument for this flag, in case it requires any.
41
- url: https://bashly.dannyb.co/configuration/flag/#arg
41
+ url: https://bashly.dev/configuration/flag/#arg
42
42
  example: |-
43
43
  flags:
44
44
  - long: --user
@@ -48,7 +48,7 @@ flag.arg:
48
48
 
49
49
  flag.completions:
50
50
  help: Specify a list of additional completion suggestions when used in conjunction with `bashly add completions`. Must be accompanied by `arg`.
51
- url: https://bashly.dannyb.co/configuration/flag/#completions
51
+ url: https://bashly.dev/configuration/flag/#completions
52
52
  example: |-
53
53
  flags:
54
54
  - long: --user
@@ -65,7 +65,7 @@ flag.completions:
65
65
 
66
66
  flag.conflicts:
67
67
  help: Specify that this flag is mutually exclusive with one or more other flags. Use the long name of these conflicting flags.
68
- url: https://bashly.dannyb.co/configuration/flag/#conflicts
68
+ url: https://bashly.dev/configuration/flag/#conflicts
69
69
  example: |-
70
70
  flags:
71
71
  - long: --cache
@@ -88,7 +88,7 @@ flag.conflicts:
88
88
 
89
89
  flag.default:
90
90
  help: Specify the value to apply when not provided by the user.
91
- url: https://bashly.dannyb.co/configuration/flag/#default
91
+ url: https://bashly.dev/configuration/flag/#default
92
92
  example: |-
93
93
  flags:
94
94
  - long: --environment
@@ -98,7 +98,7 @@ flag.default:
98
98
 
99
99
  flag.help:
100
100
  help: Specify the help message for this flag.
101
- url: https://bashly.dannyb.co/configuration/flag/#help
101
+ url: https://bashly.dev/configuration/flag/#help
102
102
  example: |-
103
103
  flags:
104
104
  - long: --cache
@@ -106,7 +106,7 @@ flag.help:
106
106
 
107
107
  flag.long:
108
108
  help: Specify the long form of the flag, including the -- prefix. Either `long` or `short` is required.
109
- url: https://bashly.dannyb.co/configuration/flag/#long
109
+ url: https://bashly.dev/configuration/flag/#long
110
110
  example: |-
111
111
  flags:
112
112
  - long: --ssh
@@ -115,7 +115,7 @@ flag.long:
115
115
 
116
116
  flag.needs:
117
117
  help: Specify that this flag needs one or more additional flags. Use the long name of these needed flags.
118
- url: https://bashly.dannyb.co/configuration/flag/#needs
118
+ url: https://bashly.dev/configuration/flag/#needs
119
119
  example: |-
120
120
  flags:
121
121
  - long: --add
@@ -138,7 +138,7 @@ flag.needs:
138
138
 
139
139
  flag.private:
140
140
  help: Specify that this flag should not be displayed in the help text.
141
- url: https://bashly.dannyb.co/configuration/flag/#private
141
+ url: https://bashly.dev/configuration/flag/#private
142
142
  example: |-
143
143
  flags:
144
144
  - long: --legacy
@@ -151,7 +151,7 @@ flag.repeatable:
151
151
  Specify that this flag can be provided multiple times. When used on a flag with an argument, it will be received as a space-delimited string, which needs to be converted to an array with:
152
152
  `eval "data=(${args[--data]})"`
153
153
 
154
- url: https://bashly.dannyb.co/configuration/flag/#repeatable
154
+ url: https://bashly.dev/configuration/flag/#repeatable
155
155
  example: |-
156
156
  flags:
157
157
  - long: --data
@@ -168,7 +168,7 @@ flag.repeatable:
168
168
 
169
169
  flag.required:
170
170
  help: Specify that this flag is required.
171
- url: https://bashly.dannyb.co/configuration/flag/#required
171
+ url: https://bashly.dev/configuration/flag/#required
172
172
  example: |-
173
173
  args:
174
174
  - long: --user
@@ -178,7 +178,7 @@ flag.required:
178
178
 
179
179
  flag.short:
180
180
  help: Specify the short form of the flag, including the - prefix. Either `long` or `short` is required.
181
- url: https://bashly.dannyb.co/configuration/flag/#short
181
+ url: https://bashly.dev/configuration/flag/#short
182
182
  example: |-
183
183
  - long: --user
184
184
  short: -u
@@ -187,7 +187,7 @@ flag.short:
187
187
 
188
188
  flag.unique:
189
189
  help: Specify that the arguments provided by this repeatable flag must be unique. When this is set to `true`, non-unique values will be ignored.
190
- url: https://bashly.dannyb.co/configuration/flag/#unique
190
+ url: https://bashly.dev/configuration/flag/#unique
191
191
  example: |-
192
192
  flags:
193
193
  - long: --path
@@ -199,7 +199,7 @@ flag.unique:
199
199
  flag.validate:
200
200
  help: Apply custom validation functions. Must be accompanied by `arg`.
201
201
 
202
- url: https://bashly.dannyb.co/configuration/flag/#validate
202
+ url: https://bashly.dev/configuration/flag/#validate
203
203
  example: |-
204
204
  flags:
205
205
  - long: --config
@@ -1,6 +1,6 @@
1
1
  variable:
2
2
  help: Define variables that will be available to your script.
3
- url: https://bashly.dannyb.co/configuration/variable/
3
+ url: https://bashly.dev/configuration/variable/
4
4
  example: |-
5
5
  variables:
6
6
  # Simple value
@@ -21,7 +21,7 @@ variable:
21
21
 
22
22
  variable.name:
23
23
  help: Specify the name of the variable.
24
- url: https://bashly.dannyb.co/configuration/variable/#name
24
+ url: https://bashly.dev/configuration/variable/#name
25
25
  example: |-
26
26
  variables:
27
27
  - name: output_folder
@@ -31,7 +31,7 @@ variable.value:
31
31
  help: |-
32
32
  Specify the value for this variable.
33
33
  This can be any value type, including array and hash (associative array).
34
- url: https://bashly.dannyb.co/configuration/variable/#value
34
+ url: https://bashly.dev/configuration/variable/#value
35
35
  example: |-
36
36
  variables:
37
37
  # Simple value
@@ -10,10 +10,21 @@
10
10
  ## Color output will be disabled if `NO_COLOR` environment variable is set
11
11
  ## in compliance with https://no-color.org/
12
12
  ##
13
+ ## In case you wish to enable auto detection for color output based on the
14
+ ## terminal being interactive (TTY), call `enable_auto_colors` in your
15
+ ## `src/initialize.sh` (Run `bashly add hooks` to add this file).
16
+ ##
17
+ enable_auto_colors() {
18
+ ## If NO_COLOR has not been set and stdout is not a TTY, disable colors
19
+ if [[ -z ${NO_COLOR+x} && ! -t 1 ]]; then
20
+ NO_COLOR=1
21
+ fi
22
+ }
23
+
13
24
  print_in_color() {
14
25
  local color="$1"
15
26
  shift
16
- if [[ -z ${NO_COLOR+x} ]]; then
27
+ if [[ "${NO_COLOR:-}" == "" ]]; then
17
28
  printf "$color%b\e[0m\n" "$*"
18
29
  else
19
30
  printf "%b\n" "$*"
@@ -3,6 +3,14 @@ colors:
3
3
  files:
4
4
  - source: "colors/colors.sh"
5
5
  target: "%{user_lib_dir}/colors.%{user_ext}"
6
+ post_install_message: |
7
+ The colors library supports the g`NO_COLOR` standard out of the box.
8
+
9
+ In case you wish to also enable automatic output of colors based on the
10
+ terminal being interactive (TTY), call g`enable_auto_colors` in your
11
+ g`src/initialize.sh`. You may run the following command to add this file:
12
+
13
+ m`$ bashly add hooks`
6
14
 
7
15
  completions:
8
16
  help: Generate a bash completions function.
@@ -110,6 +110,7 @@ enable_view_markers: development
110
110
  enable_inspect_args: development
111
111
  enable_deps_array: always
112
112
  enable_env_var_names_array: always
113
+ enable_sourcing: development
113
114
 
114
115
 
115
116
  #-------------------------------------------------------------------------------
@@ -13,6 +13,7 @@ module Bashly
13
13
  :enable_env_var_names_array,
14
14
  :enable_header_comment,
15
15
  :enable_inspect_args,
16
+ :enable_sourcing,
16
17
  :enable_view_markers,
17
18
  :lib_dir,
18
19
  :partials_extension,
@@ -48,28 +49,32 @@ module Bashly
48
49
  (send(:"enable_#{feature}") == 'development' && !production?)
49
50
  end
50
51
 
51
- def enable_header_comment
52
- @enable_header_comment ||= get :enable_header_comment
53
- end
54
-
55
52
  def enable_bash3_bouncer
56
53
  @enable_bash3_bouncer ||= get :enable_bash3_bouncer
57
54
  end
58
55
 
59
- def enable_view_markers
60
- @enable_view_markers ||= get :enable_view_markers
56
+ def enable_deps_array
57
+ @enable_deps_array ||= get :enable_deps_array
58
+ end
59
+
60
+ def enable_env_var_names_array
61
+ @enable_env_var_names_array ||= get :enable_env_var_names_array
62
+ end
63
+
64
+ def enable_header_comment
65
+ @enable_header_comment ||= get :enable_header_comment
61
66
  end
62
67
 
63
68
  def enable_inspect_args
64
69
  @enable_inspect_args ||= get :enable_inspect_args
65
70
  end
66
71
 
67
- def enable_deps_array
68
- @enable_deps_array ||= get :enable_deps_array
72
+ def enable_sourcing
73
+ @enable_sourcing ||= get :enable_sourcing
69
74
  end
70
75
 
71
- def enable_env_var_names_array
72
- @enable_env_var_names_array ||= get :enable_env_var_names_array
76
+ def enable_view_markers
77
+ @enable_view_markers ||= get :enable_view_markers
73
78
  end
74
79
 
75
80
  def env
@@ -1,3 +1,3 @@
1
1
  module Bashly
2
- VERSION = '1.2.7'
2
+ VERSION = '1.2.9'
3
3
  end
@@ -1,5 +1,5 @@
1
1
  = view_marker
2
-
2
+ > declare -g long_usage=''
3
3
  > declare -g -A args=()
4
4
 
5
5
  if catch_all_used_anywhere?
@@ -1,8 +1,7 @@
1
1
  = view_marker
2
2
 
3
3
  > initialize() {
4
- > version="<%= version %>"
5
- > long_usage=''
4
+ > declare -g version="<%= version %>"
6
5
  > {{ Settings.strict_string }}
7
6
 
8
7
  if root_command?
@@ -11,8 +10,6 @@ if root_command?
11
10
  = render(:environment_variables_default).indent 2
12
11
  end
13
12
 
14
- = render(:globals).indent(2)
15
-
16
13
  if user_file_exist?('initialize')
17
14
  >
18
15
  = load_user_file('initialize').indent 2
@@ -13,6 +13,13 @@
13
13
  = render :run
14
14
 
15
15
  >
16
- > initialize
17
- > run "$@"
18
- >
16
+ if Settings.enabled? :sourcing
17
+ > if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
18
+ > initialize
19
+ > run "$@"
20
+ > fi
21
+ else
22
+ > initialize
23
+ > run "$@"
24
+ end
25
+ >
@@ -1,6 +1,8 @@
1
1
  = view_marker
2
2
 
3
3
  > run() {
4
+ = render(:globals).indent(2)
5
+ >
4
6
  > normalize_input "$@"
5
7
  > parse_requirements "${input[@]}"
6
8
 
@@ -1,6 +1,6 @@
1
1
  > #!/usr/bin/env bash
2
2
  if Settings.enabled? :header_comment
3
- > # This script was generated by bashly {{ Bashly::VERSION }} (https://bashly.dannyb.co)
3
+ > # This script was generated by bashly {{ Bashly::VERSION }} (https://bashly.dev)
4
4
  > # Modifying it manually is not recommended
5
5
  end
6
6
  >
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bashly
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.7
4
+ version: 1.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-12-28 00:00:00.000000000 Z
10
+ date: 2025-01-27 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: colsole
@@ -346,10 +345,9 @@ licenses:
346
345
  metadata:
347
346
  bug_tracker_uri: https://github.com/DannyBen/bashly/issues
348
347
  changelog_uri: https://github.com/DannyBen/bashly/blob/master/CHANGELOG.md
349
- homepage_uri: https://bashly.dannyb.co/
348
+ homepage_uri: https://bashly.dev/
350
349
  source_code_uri: https://github.com/DannyBen/bashly
351
350
  rubygems_mfa_required: 'true'
352
- post_install_message:
353
351
  rdoc_options: []
354
352
  require_paths:
355
353
  - lib
@@ -364,8 +362,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
364
362
  - !ruby/object:Gem::Version
365
363
  version: '0'
366
364
  requirements: []
367
- rubygems_version: 3.5.23
368
- signing_key:
365
+ rubygems_version: 3.6.2
369
366
  specification_version: 4
370
367
  summary: Bash Command Line Tool Generator
371
368
  test_files: []