From 7592f43dea9094346fa0ee687a5c2e6888075109 Mon Sep 17 00:00:00 2001 From: "Stephen M. Coakley" Date: Tue, 2 Jan 2018 11:26:20 -0600 Subject: [PATCH] fix: smarter AWK detection that supports nawk --- .travis.yml | 2 +- README.md | 2 +- bin/install | 11 ++++++++--- bin/install.sha256 | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 242fbee..73516ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,7 @@ before_script: - tree -h - export - pushd bin; sha256sum -c install.sha256; popd - - fish $TRAVIS_BUILD_DIR/bin/install --offline --noninteractive --yes + - fish $TRAVIS_BUILD_DIR/bin/install --verbose --offline --noninteractive --yes script: - tests/run.fish diff --git a/README.md b/README.md index 8cc86ea..999fe42 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ fish install --path=~/.local/share/omf --config=~/.config/omf You can verify the integrity of the downloaded installer by verifying the script against [this checksum](bin/install.sha256): ``` -bedbff763e374d5ca3367fa75b322302411e961947133eb22c7115083ba3a3ff install +4dd63d6a974a61c100cbe145ae46eac69edce985f20b061f353cc399b36c7587 install ``` You can also install Oh My Fish with Git or with an offline source tarball downloaded from the [releases page][releases]: diff --git a/bin/install b/bin/install index aeee046..8df08a5 100755 --- a/bin/install +++ b/bin/install @@ -466,8 +466,9 @@ function sane_environment_check and test "$result[3]" = 1.2.3 or abort (which sort)" is not a sane 'sort' implementation" - debug "Checking AWK version" - if not cmd awk -Wv | cmd grep -i -q AWK + debug "Checking for a working AWK interpreter" + cmd awk 'BEGIN{exit 42;}' < /dev/null ^ /dev/null + if not test $status -eq 42 abort (which awk)" does not look like an AWK interpreter." end @@ -581,7 +582,11 @@ end # A link-following `which` wrapper. function which - command readlink (command which $argv) + if type -q realpath + realpath (command which $argv) + else + command readlink (command which $argv) + end end diff --git a/bin/install.sha256 b/bin/install.sha256 index 8b7fbf6..1c7a2ac 100644 --- a/bin/install.sha256 +++ b/bin/install.sha256 @@ -1 +1 @@ -bedbff763e374d5ca3367fa75b322302411e961947133eb22c7115083ba3a3ff install +4dd63d6a974a61c100cbe145ae46eac69edce985f20b061f353cc399b36c7587 install