diff options
Diffstat (limited to '')
-rw-r--r-- | _tils/2020-12-15-awk-snippet-shellcheck-all-scripts-in-a-repository.md | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/_tils/2020-12-15-awk-snippet-shellcheck-all-scripts-in-a-repository.md b/_tils/2020-12-15-awk-snippet-shellcheck-all-scripts-in-a-repository.md index cc2e02c..71d10a3 100644 --- a/_tils/2020-12-15-awk-snippet-shellcheck-all-scripts-in-a-repository.md +++ b/_tils/2020-12-15-awk-snippet-shellcheck-all-scripts-in-a-repository.md @@ -4,6 +4,8 @@ title: 'Awk snippet: ShellCheck all scripts in a repository' date: 2020-12-15 +updated_at: 2020-12-16 + layout: post lang: en @@ -22,8 +24,7 @@ tidy with [ShellCheck][shellcheck]. Here's the first version of `assert-shellcheck.sh`: ```shell -#!/bin/sh -set -eu +#!/bin/sh -eux find . -type f -name '*.sh' -print0 | xargs -0 shellcheck ``` @@ -136,8 +137,7 @@ look for the first. Let's put it back into the `assert-shellcheck.sh` file and use `NULL` for separators to accommodate files with spaces in the name: ``` -#!/usr/sh -set -eu +#!/usr/sh -eux git ls-files -z | \ xargs -0 awk 'FNR>1 { nextfile } /^#!\// { print FILENAME; nextfile }' | \ @@ -158,8 +158,7 @@ After publishing, I could remove `{ nextfile }` and even make the script simpler: ```shell -#!/usr/sh -set -eu +#!/usr/sh -eux git ls-files -z | \ xargs -0 awk 'FNR==1 && /^#!\// { print FILENAME }' | \ |