From 6a71b6f1851c213e7c40c02c2bc1acb0379c272c Mon Sep 17 00:00:00 2001 From: Geoffrey McClinsey Date: Thu, 28 Dec 2017 01:29:50 -0500 Subject: [PATCH 1/2] fix what shellcheck will find --- install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 04e0cf7..dcc70c0 100755 --- a/install.sh +++ b/install.sh @@ -7,7 +7,7 @@ _fetch_sources(){ mkdir ~/.nano/ fi - cd ~/.nano/ + cd ~/.nano/ || exit unzip -o "/tmp/nanorc.zip" mv nanorc-master/* ./ @@ -22,9 +22,9 @@ _update_nanorc(){ fi # add all includes from ~/.nano/nanorc if they're not already there - while read inc; do + while read -r inc; do if ! grep -q "$inc" "${NANORC_FILE}"; then - echo "$inc" >> $NANORC_FILE + echo "$inc" >> "$NANORC_FILE" fi done < ~/.nano/nanorc } From 211ef147249920c77ca774ce498acafd935e0def Mon Sep 17 00:00:00 2001 From: Geoffrey McClinsey Date: Thu, 28 Dec 2017 01:31:13 -0500 Subject: [PATCH 2/2] introduce travis/shellcheck --- .travis.yml | 12 ++++++++++++ shellcheck.sh | 4 ++++ 2 files changed, 16 insertions(+) create mode 100644 .travis.yml create mode 100755 shellcheck.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b8b5de3 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +sudo: required +dist: trusty + +before_install: + - echo 'deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse' | sudo tee -a /etc/apt/sources.list + - sudo apt-get -qq update + - sudo apt-get install -y shellcheck + +git: + depth: 3 + +script: ./shellcheck.sh diff --git a/shellcheck.sh b/shellcheck.sh new file mode 100755 index 0000000..22ad42b --- /dev/null +++ b/shellcheck.sh @@ -0,0 +1,4 @@ +#!/bin/sh -ev +# Shellcheck the script + +shellcheck install.sh