diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-04-05 21:08:39 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-04-05 21:09:19 +1200 |
commit | 165c35c70b43349e882bd44be31c0837ab19729b (patch) | |
tree | 2a1f4218b78721c3262ac0c0b634629037f50ce6 | |
parent | Remove mail/mailrc from ignored files (diff) | |
download | dotfiles-165c35c70b43349e882bd44be31c0837ab19729b.tar.gz dotfiles-165c35c70b43349e882bd44be31c0837ab19729b.zip |
More sh flexibility (check/lint scripts)
-rw-r--r-- | Makefile | 32 | ||||
-rw-r--r--[-rwxr-xr-x] | check/bash.sh (renamed from check/bash) | 1 | ||||
-rwxr-xr-x | check/bin | 14 | ||||
-rw-r--r-- | check/bin.sh | 4 | ||||
-rwxr-xr-x | check/games | 14 | ||||
-rw-r--r-- | check/games.sh | 4 | ||||
-rw-r--r--[-rwxr-xr-x] | check/ksh.sh (renamed from check/ksh) | 1 | ||||
-rw-r--r--[-rwxr-xr-x] | check/man.sh (renamed from check/man) | 1 | ||||
-rw-r--r--[-rwxr-xr-x] | check/sh.sh (renamed from check/sh) | 1 | ||||
-rwxr-xr-x | check/urxvt | 9 | ||||
-rw-r--r-- | check/urxvt.sh | 4 | ||||
-rw-r--r--[-rwxr-xr-x] | check/yash.sh (renamed from check/yash) | 1 | ||||
-rw-r--r--[-rwxr-xr-x] | check/zsh.sh (renamed from check/zsh) | 1 | ||||
-rw-r--r--[-rwxr-xr-x] | lint/bash.sh (renamed from lint/bash) | 1 | ||||
-rw-r--r--[-rwxr-xr-x] | lint/bin.sh (renamed from lint/bin) | 1 | ||||
-rw-r--r--[-rwxr-xr-x] | lint/games.sh (renamed from lint/games) | 1 | ||||
-rw-r--r--[-rwxr-xr-x] | lint/ksh.sh (renamed from lint/ksh) | 1 | ||||
-rw-r--r--[-rwxr-xr-x] | lint/sh.sh (renamed from lint/sh) | 1 | ||||
-rw-r--r--[-rwxr-xr-x] | lint/urxvt.sh (renamed from lint/urxvt) | 1 | ||||
-rw-r--r--[-rwxr-xr-x] | lint/yash.sh (renamed from lint/yash) | 1 |
20 files changed, 28 insertions, 66 deletions
@@ -459,31 +459,31 @@ check: check-bash \ check-urxvt check-bash: - check/bash + sh check/bash.sh check-bin: $(BINS) - check/bin + sh check/bin.sh check-games: $(GAMES) - check/games + sh check/games.sh check-man: - check/man + sh check/man.sh check-ksh: - check/ksh + sh check/ksh.sh check-sh: - check/sh + sh check/sh.sh check-urxvt: - check/urxvt + sh check/urxvt.sh check-yash: - check/yash + sh check/yash.sh check-zsh: - check/zsh + sh check/zsh.sh lint: check \ lint-bash \ @@ -495,22 +495,22 @@ lint: check \ lint-yash lint-bash: - lint/bash + sh lint/bash.sh lint-bin: - lint/bin + sh lint/bin.sh lint-games: - lint/games + sh lint/games.sh lint-ksh: - lint/ksh + sh lint/ksh.sh lint-sh: - lint/sh + sh lint/sh.sh lint-urxvt: - lint/urxvt + sh lint/urxvt.sh lint-yash: - lint/yash + sh lint/yash.sh diff --git a/check/bash b/check/bash.sh index 525bec34..a3efccb1 100755..100644 --- a/check/bash +++ b/check/bash.sh @@ -1,4 +1,3 @@ -#!/bin/sh for bash in bash/* bash/bashrc.d/* ; do [ -f "$bash" ] || continue bash -n "$bash" || exit diff --git a/check/bin b/check/bin deleted file mode 100755 index 2fc4e767..00000000 --- a/check/bin +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -for bin in bin/* ; do - [ -x "$bin" ] || continue - hb=$(sed 1q "$bin") || exit - case $hb in - *bash) - bash -n "$bin" || exit - ;; - *sh) - sh -n "$bin" || exit - ;; - esac -done -printf 'All shell scripts in bin parsed successfully.\n' diff --git a/check/bin.sh b/check/bin.sh new file mode 100644 index 00000000..04b0da6b --- /dev/null +++ b/check/bin.sh @@ -0,0 +1,4 @@ +for bin in bin/*.sh ; do + sh -n "$bin" || exit +done +printf 'All shell scripts in bin parsed successfully.\n' diff --git a/check/games b/check/games deleted file mode 100755 index d3b5feac..00000000 --- a/check/games +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -for game in games/* ; do - [ -x "$game" ] || continue - hb=$(sed 1q "$game") || exit - case $hb in - *bash) - bash -n "$game" || exit - ;; - *sh) - sh -n "$game" || exit - ;; - esac -done -printf 'All shell scripts in games parsed successfully.\n' diff --git a/check/games.sh b/check/games.sh new file mode 100644 index 00000000..79d53ed5 --- /dev/null +++ b/check/games.sh @@ -0,0 +1,4 @@ +for game in games/*.sh ; do + sh -n "$game" || exit +done +printf 'All shell scripts in games parsed successfully.\n' diff --git a/check/ksh b/check/ksh.sh index 3136c413..51e71e19 100755..100644 --- a/check/ksh +++ b/check/ksh.sh @@ -1,4 +1,3 @@ -#!/bin/sh for ksh in ksh/* ksh/kshrc.d/* ; do [ -f "$ksh" ] || continue ksh -n "$ksh" || exit diff --git a/check/man b/check/man.sh index ca1c248c..89c03890 100755..100644 --- a/check/man +++ b/check/man.sh @@ -1,4 +1,3 @@ -#!/bin/sh # Check that manual pages and logical binaries match up # Need some scripts from the source directory diff --git a/check/sh b/check/sh.sh index ec3ba339..53d8c4b6 100755..100644 --- a/check/sh +++ b/check/sh.sh @@ -1,4 +1,3 @@ -#!/bin/sh for sh in sh/* sh/profile.d/* sh/shrc.d/* ; do [ -f "$sh" ] || continue sh -n "$sh" || exit diff --git a/check/urxvt b/check/urxvt deleted file mode 100755 index a40f8559..00000000 --- a/check/urxvt +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -for perl in urxvt/ext/* ; do - [ -f "$perl" ] || continue - case $perl in - *.pl) ;; - *) perl -c "$perl" >/dev/null || exit ;; - esac -done -printf 'All Perl scripts in urxvt/ext parsed successfully.\n' diff --git a/check/urxvt.sh b/check/urxvt.sh new file mode 100644 index 00000000..ee39e6c9 --- /dev/null +++ b/check/urxvt.sh @@ -0,0 +1,4 @@ +for perl in urxvt/ext/*.pl ; do + perl -c "$perl" || exit +done +printf 'All Perl scripts in urxvt/ext parsed successfully.\n' diff --git a/check/yash b/check/yash.sh index fb737596..c8722f3d 100755..100644 --- a/check/yash +++ b/check/yash.sh @@ -1,4 +1,3 @@ -#!/bin/sh for yash in yash/* ; do [ -f "$yash" ] || continue yash -n "$yash" || exit diff --git a/check/zsh b/check/zsh.sh index 39a6c1e9..50335d56 100755..100644 --- a/check/zsh +++ b/check/zsh.sh @@ -1,4 +1,3 @@ -#!/bin/sh for zsh in zsh/* zsh/zshrc.d/* ; do [ -f "$zsh" ] || continue zsh -n "$zsh" || exit diff --git a/lint/bash b/lint/bash.sh index 771f2a89..2fe1ba13 100755..100644 --- a/lint/bash +++ b/lint/bash.sh @@ -1,2 +1 @@ -#!/bin/sh find bash -type f -print -exec shellcheck -e SC1090 -s bash -- {} + diff --git a/lint/bin b/lint/bin.sh index ff7de0b7..0fe82d7a 100755..100644 --- a/lint/bin +++ b/lint/bin.sh @@ -1,2 +1 @@ -#!/bin/sh find bin -type f -name '*.sh' -print -exec shellcheck -e SC1090 -s sh -- {} + diff --git a/lint/games b/lint/games.sh index 38299a7f..6e3e3024 100755..100644 --- a/lint/games +++ b/lint/games.sh @@ -1,2 +1 @@ -#!/bin/sh find games -type f -name '*.sh' -print -exec shellcheck -e SC1090 -s sh -- {} + diff --git a/lint/ksh b/lint/ksh.sh index ee49d178..4cedc6f7 100755..100644 --- a/lint/ksh +++ b/lint/ksh.sh @@ -1,4 +1,3 @@ -#!/bin/sh find ksh \ -type f -name '*.sh' -exec shellcheck -e SC1090 -s sh -- {} + -o \ -type f -exec shellcheck -e SC1090 -s ksh -- {} + diff --git a/lint/sh b/lint/sh.sh index 18f2f551..632585bf 100755..100644 --- a/lint/sh +++ b/lint/sh.sh @@ -1,2 +1 @@ -#!/bin/sh find sh -type f -print -exec shellcheck -e SC1090 -s sh -- {} + diff --git a/lint/urxvt b/lint/urxvt.sh index 9fd6193d..507034be 100755..100644 --- a/lint/urxvt +++ b/lint/urxvt.sh @@ -1,2 +1 @@ -#!/bin/sh find urxvt/ext -type f ! -name '*.pl' -print -exec perlcritic --brutal -- {} \; diff --git a/lint/yash b/lint/yash.sh index 1397f9f1..d783e077 100755..100644 --- a/lint/yash +++ b/lint/yash.sh @@ -1,2 +1 @@ -#!/bin/sh find yash -type f -print -exec shellcheck -e SC1090 -s sh -- {} + |