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

Lines changed: 9 additions & 1 deletion
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

Lines changed: 9 additions & 1 deletion
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

Lines changed: 9 additions & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 9 additions & 0 deletions
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

Lines changed: 9 additions & 0 deletions
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

Lines changed: 9 additions & 0 deletions
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

Lines changed: 9 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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)

0 commit comments

Comments
 (0)