Fix Travis (#47)

* Install shellcheck manually

* Use `read` instead of built-in glob splitting
This commit is contained in:
Tad Fisher 2018-01-21 18:40:02 -08:00 committed by GitHub
parent 7e54497f88
commit fd083fab36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View File

@ -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

View File

@ -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