Skip to content

Commit efb5ad8

Browse files
committed
spec approvals
1 parent a4bbae9 commit efb5ad8

File tree

13 files changed

+86
-6
lines changed

13 files changed

+86
-6
lines changed

examples/colors/src/lib/colors.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,18 @@
1010
## Color output will be disabled if `NO_COLOR` environment variable is set
1111
## in compliance with https://no-color.org/
1212
##
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+
[[ -z ${NO_COLOR+x} && ! -t 1 ]] && NO_COLOR=1 || true
19+
}
20+
1321
print_in_color() {
1422
local color="$1"
1523
shift
16-
if [[ -z ${NO_COLOR+x} ]]; then
24+
if [[ "${NO_COLOR:-}" == "" ]]; then
1725
printf "$color%b\e[0m\n" "$*"
1826
else
1927
printf "%b\n" "$*"

examples/dependencies-alt/src/lib/colors.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,18 @@
1010
## Color output will be disabled if `NO_COLOR` environment variable is set
1111
## in compliance with https://no-color.org/
1212
##
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+
[[ -z ${NO_COLOR+x} && ! -t 1 ]] && NO_COLOR=1 || true
19+
}
20+
1321
print_in_color() {
1422
local color="$1"
1523
shift
16-
if [[ -z ${NO_COLOR+x} ]]; then
24+
if [[ "${NO_COLOR:-}" == "" ]]; then
1725
printf "$color%b\e[0m\n" "$*"
1826
else
1927
printf "%b\n" "$*"

examples/dependencies/src/lib/colors.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,18 @@
1010
## Color output will be disabled if `NO_COLOR` environment variable is set
1111
## in compliance with https://no-color.org/
1212
##
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+
[[ -z ${NO_COLOR+x} && ! -t 1 ]] && NO_COLOR=1 || true
19+
}
20+
1321
print_in_color() {
1422
local color="$1"
1523
shift
16-
if [[ -z ${NO_COLOR+x} ]]; then
24+
if [[ "${NO_COLOR:-}" == "" ]]; then
1725
printf "$color%b\e[0m\n" "$*"
1826
else
1927
printf "%b\n" "$*"

examples/render-mandoc/docs/download.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" Automatically generated by Pandoc 3.2
22
.\"
3-
.TH "download" "1" "December 2024" "Version 0.1.0" "Sample application"
3+
.TH "download" "1" "January 2025" "Version 0.1.0" "Sample application"
44
.SH NAME
55
\f[B]download\f[R] \- Sample application
66
.SH SYNOPSIS

examples/render-mandoc/docs/download.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% download(1) Version 0.1.0 | Sample application
22
% Lana Lang
3-
% December 2024
3+
% January 2025
44

55
NAME
66
==================================================

spec/approvals/cli/add/colors

+9
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
11
created spec/tmp/src/lib/colors.sh
2+
3+
The colors library supports the NO_COLOR standard out of the box.
4+
5+
In case you wish to also enable automatic output of colors based on the
6+
terminal being interactive (TTY), call enable_auto_colors in your
7+
src/initialize.sh. You may run the following command to add this file:
8+
9+
$ bashly add hooks
10+

spec/approvals/examples/colors

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
+ bashly add colors --force
22
created src/lib/colors.sh
3+
4+
The colors library supports the NO_COLOR standard out of the box.
5+
6+
In case you wish to also enable automatic output of colors based on the
7+
terminal being interactive (TTY), call enable_auto_colors in your
8+
src/initialize.sh. You may run the following command to add this file:
9+
10+
$ bashly add hooks
11+
312
+ bashly generate
413
creating user files in src
514
skipped src/root_command.sh (exists)

spec/approvals/examples/dependencies

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
+ bashly add colors
22
created src/lib/colors.sh
3+
4+
The colors library supports the NO_COLOR standard out of the box.
5+
6+
In case you wish to also enable automatic output of colors based on the
7+
terminal being interactive (TTY), call enable_auto_colors in your
8+
src/initialize.sh. You may run the following command to add this file:
9+
10+
$ bashly add hooks
11+
312
+ bashly generate
413
creating user files in src
514
created src/download_command.sh

spec/approvals/examples/dependencies-alt

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
+ bashly add colors
22
created src/lib/colors.sh
3+
4+
The colors library supports the NO_COLOR standard out of the box.
5+
6+
In case you wish to also enable automatic output of colors based on the
7+
terminal being interactive (TTY), call enable_auto_colors in your
8+
src/initialize.sh. You may run the following command to add this file:
9+
10+
$ bashly add hooks
11+
312
+ bashly generate
413
creating user files in src
514
created src/download_command.sh

spec/approvals/examples/render-mandoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ ISSUE TRACKER
4444
AUTHORS
4545
Lana Lang.
4646

47-
Version 0.1.0 December 2024 download(1)
47+
Version 0.1.0 January 2025 download(1)

spec/approvals/fixtures/lib-custom-path

+9
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ run ./cli --help to test your bash script
77
created src/my-libz/sample_function.sh
88
+ bundle exec bashly add colors
99
created src/my-libz/colors.sh
10+
11+
The colors library supports the NO_COLOR standard out of the box.
12+
13+
In case you wish to also enable automatic output of colors based on the
14+
terminal being interactive (TTY), call enable_auto_colors in your
15+
src/initialize.sh. You may run the following command to add this file:
16+
17+
$ bashly add hooks
18+
1019
+ bundle exec bashly generate
1120
creating user files in src
1221
skipped src/root_command.sh (exists)

spec/approvals/fixtures/partials-extension

+9
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ created ./cli
1111
run ./cli --help to test your bash script
1212
+ bundle exec bashly add colors
1313
created src/lib/colors.bash
14+
15+
The colors library supports the NO_COLOR standard out of the box.
16+
17+
In case you wish to also enable automatic output of colors based on the
18+
terminal being interactive (TTY), call enable_auto_colors in your
19+
src/initialize.sh. You may run the following command to add this file:
20+
21+
$ bashly add hooks
22+
1423
+ bundle exec bashly add completions
1524
created src/lib/send_completions.bash
1625

spec/bashly/library_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232

3333
describe '#post_install_message' do
3434
context 'when the library has no configured message' do
35+
let(:name) { :config }
36+
3537
it 'returns nil' do
3638
expect(subject.post_install_message).to be_nil
3739
end

0 commit comments

Comments
 (0)