aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTad Fisher <tadfisher@gmail.com>2018-01-21 18:40:02 -0800
committerGitHub <noreply@github.com>2018-01-21 18:40:02 -0800
commitfd083fab36330f54260034b5bbe6ce1d9ee44b51 (patch)
tree9e70dbad09bf5578f94957eb75eada2876c2ff35
parent7e54497f8889427cfaad5893b265309a7b60dfc7 (diff)
Fix Travis (#47)
* Install shellcheck manually * Use `read` instead of built-in glob splitting
-rw-r--r--.travis.yml15
-rwxr-xr-xotp.bash3
2 files changed, 14 insertions, 4 deletions
diff --git a/.travis.yml b/.travis.yml
index d467dbf..d548c3b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,5 @@
dist: trusty
+sudo: false
language: bash
@@ -8,22 +9,30 @@ env:
addons:
apt:
- sources:
- - debian-sid
packages:
+ - cabal-install
- expect
+ - ghc
- oathtool
- - shellcheck
before_script:
- wget https://git.zx2c4.com/password-store/snapshot/password-store-$PASS_VERSION.tar.xz
- tar -xvf password-store-$PASS_VERSION.tar.xz
- ln -s password-store-$PASS_VERSION/src/password-store.sh pass
+ - if [ ! -f "${HOME}/.cabal/bin/shellcheck" ]; then cabal update; cabal install ShellCheck; fi
+ - ln -s "${HOME}/.cabal/bin/shellcheck" shellcheck
- export PATH=$PATH:.
- export TEST_OPTS="-v"
install: true
+before_cache:
+ - rm $HOME/.cabal/logs/build.log
+
+cache:
+ directories:
+ - $HOME/.cabal
+
script:
- make lint
- cd test && make all
diff --git a/otp.bash b/otp.bash
index 16d0ef4..7d42f66 100755
--- a/otp.bash
+++ b/otp.bash
@@ -59,7 +59,8 @@ otp_parse_uri() {
[[ -z $otp_accountname ]] && die "Invalid key URI (missing accountname): $otp_uri"
local p=${BASH_REMATCH[7]}
- local IFS=\&; local params=(${p[@]}); unset IFS
+ local params
+ local IFS=\&; read -r -a params <<< "$p"; unset IFS
pattern='^(.+)=(.+)$'
for param in "${params[@]}"; do