Skip to content

Commit 4925106

Browse files
committed
- Update dependency check to show all missing dependencies at once
1 parent 5fbb406 commit 4925106

File tree

8 files changed

+29
-10
lines changed

8 files changed

+29
-10
lines changed

examples/command-private/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Usage:
6767
cli --version | -v
6868

6969
Commands:
70-
connect Connect to the metaverse
70+
connect Connect to the metaverse
7171

7272

7373

@@ -84,7 +84,7 @@ Usage:
8484
cli --version | -v
8585

8686
Commands:
87-
connect Connect to the metaverse
87+
connect Connect to the metaverse
8888

8989
Options:
9090
--help, -h

examples/dependencies-alt/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ args: none
6060
deps:
6161
- ${deps[git]} = /usr/bin/git
6262
- ${deps[http_client]} = /usr/bin/curl
63-
- ${deps[ruby]} = /home/vagrant/.rbenv/versions/3.3.0/bin/ruby
63+
- ${deps[ruby]} = /home/vagrant/.rbenv/versions/3.3.6/bin/ruby
6464

6565

6666
````

examples/dependencies/README.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ commands:
3131
dependencies:
3232
- git
3333
- curl
34-
- shmurl
34+
- dos
35+
- netscape
3536

3637
- name: upload
3738
help: Upload something
@@ -40,6 +41,7 @@ commands:
4041
# The message can use colors from the colors library (bashly add colors).
4142
dependencies:
4243
mini-docker: install with $(green gem install mini-docker)
44+
multi-docker: install with $(blue gem install multi-docker)
4345
docker: visit https://docker.com for more information
4446
````
4547

@@ -50,7 +52,8 @@ commands:
5052
### `$ ./cli download`
5153

5254
````shell
53-
missing dependency: shmurl
55+
missing dependency: dos
56+
missing dependency: netscape
5457

5558

5659
````
@@ -61,6 +64,10 @@ missing dependency: shmurl
6164
missing dependency: mini-docker
6265
install with gem install mini-docker
6366

67+
missing dependency: multi-docker
68+
install with gem install multi-docker
69+
70+
6471

6572
````
6673

examples/dependencies/src/bashly.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ commands:
1212
dependencies:
1313
- git
1414
- curl
15-
- shmurl
15+
- dos
16+
- netscape
1617

1718
- name: upload
1819
help: Upload something
@@ -21,4 +22,5 @@ commands:
2122
# The message can use colors from the colors library (bashly add colors).
2223
dependencies:
2324
mini-docker: install with $(green gem install mini-docker)
25+
multi-docker: install with $(blue gem install multi-docker)
2426
docker: visit https://docker.com for more information

examples/render-mandoc/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ ISSUE TRACKER
102102
AUTHORS
103103
Lana Lang.
104104

105-
Version 0.1.0 August 2024 download(1)
105+
Version 0.1.0 December 2024 download(1)
106106

107107

108108
````
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
if dependencies.any?
22
= view_marker
33

4+
> missing_deps=
45
dependencies.each do |dependency|
56
= dependency.render :filter
67
end
8+
9+
> if [[ -n $missing_deps ]]; then
10+
> exit 1
11+
> fi
712
end

lib/bashly/views/dependency/filter.gtx

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
> if ! command -v {{ commands.join(' ') }} >/dev/null 2>&1; then
44
> printf "{{ strings[:missing_dependency] % { dependency: name } }}\n" >&2
55
if help
6-
> printf "%s\n" "{{ help.sanitize_for_print }}" >&2
6+
> printf "%s\n\n" "{{ help.sanitize_for_print }}" >&2
77
end
8-
> exit 1
8+
> missing_deps=1
99
if Settings.enabled? :deps_array
1010
> else
1111
> deps['{{ label }}']="$(command -v {{ commands.join(' ') }} | head -n1)"

spec/approvals/examples/dependencies

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ created src/upload_command.sh
77
created ./cli
88
run ./cli --help to test your bash script
99
+ ./cli download
10-
missing dependency: shmurl
10+
missing dependency: dos
11+
missing dependency: netscape
1112
+ ./cli upload
1213
missing dependency: mini-docker
1314
install with gem install mini-docker
15+
16+
missing dependency: multi-docker
17+
install with gem install multi-docker
18+

0 commit comments

Comments
 (0)