Skip to content

Commit 2c175f9

Browse files
committed
fixes
1 parent 41da133 commit 2c175f9

File tree

6 files changed

+8
-36
lines changed

6 files changed

+8
-36
lines changed

.github/workflows/static-analysis.yml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55

66
jobs:
77
static_analysis:
8-
name: Example files static analysis
8+
name: Run shellcheck and shfmt
99

1010
runs-on: ubuntu-latest
1111

@@ -52,7 +52,7 @@ jobs:
5252
run: bundle exec run shfmt fixtures
5353

5454
json_schema:
55-
name: JSON schemas validation
55+
name: Validate JSON schemas
5656

5757
runs-on: ubuntu-latest
5858

@@ -100,18 +100,3 @@ jobs:
100100

101101
- name: Run codespell
102102
run: codespell
103-
104-
docker:
105-
name: Docker smoke test
106-
107-
runs-on: ubuntu-latest
108-
109-
steps:
110-
- name: Checkout code
111-
uses: actions/checkout@v4
112-
113-
- name: Build the image
114-
run: docker compose build bash
115-
116-
- name: Test pandoc presence
117-
run: docker compose run pandoc-test

lib/bashly/views/argument/validations.gtx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ if validate
33

44
if repeatable
55
> if [[ -v args['{{ name }}'] ]]; then
6-
> read -a values <<<"${args['{{ name }}']}"
6+
> read -r -a values <<<"${args['{{ name }}']}"
77
> for value in "${values[@]}"; do
88
> if [[ -n $(validate_{{ validate }} "$value") ]]; then
99
> printf "{{ strings[:validation_error] }}\n" "{{ name.upcase }}" "$(validate_{{ validate }} "$value")" >&2

lib/bashly/views/command/whitelist_filter.gtx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ if whitelisted_args.any? or whitelisted_flags.any?
33

44
whitelisted_args.each do |arg|
55
if arg.repeatable
6-
> read -a input_array <<<"${args['{{ arg.name }}']}"
6+
> read -r -a input_array <<<"${args['{{ arg.name }}']}"
77
> for i in "${input_array[@]}"; do
88
> if [[ ! $i =~ ^({{ arg.allowed.join '|' }})$ ]]; then
99
> printf "%s\n" "{{ strings[:disallowed_argument] % { name: arg.name, allowed: arg.allowed.join(', ') } }}" >&2
@@ -22,7 +22,7 @@ if whitelisted_args.any? or whitelisted_flags.any?
2222

2323
whitelisted_flags.each do |flag|
2424
if flag.repeatable
25-
> read -a input_array <<<"${args['{{ flag.name }}']}"
25+
> read -r -a input_array <<<"${args['{{ flag.name }}']}"
2626
> for i in "${input_array[@]}"; do
2727
> if [[ ! $i =~ ^({{ flag.allowed.join '|' }})$ ]]; then
2828
> printf "%s\n" "{{ strings[:disallowed_flag] % { name: flag.name, allowed: flag.allowed.join(', ') } }}" >&2

lib/bashly/views/flag/validations.gtx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ if validate
33

44
if repeatable
55
> if [[ -v args['{{ long }}'] ]]; then
6-
> read -a values <<<"${args['{{ long }}']}"
6+
> read -r -a values <<<"${args['{{ long }}']}"
77
> for value in "${values[@]}"; do
88
> if [[ -n $(validate_{{ validate }} "$value") ]]; then
99
> printf "{{ strings[:validation_error] }}\n" "{{ usage_string }}" "$(validate_{{ validate }} "$value")" >&2

spec/fixtures/workspaces/repeatable-escaping/src/root_command.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
inspect_args
22

33
if [[ -v args[term] ]]; then
4-
read -a terms <<< "${args['term']}"
4+
read -r -a terms <<<"${args['term']}"
55
for t in "${terms[@]}"; do
66
echo "[TERM] --> ${t}"
77
done
88
fi
99

1010
if [[ -v args[--search] ]]; then
11-
read -a terms <<< "${args['--search']}"
11+
read -r -a terms <<<"${args['--search']}"
1212
for t in "${terms[@]}"; do
1313
echo "[--serach] --> ${t}"
1414
done

spec/fixtures/workspaces/test.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)