From ad811ed1c433eaf91dce8c8fcb97b17985311f84 Mon Sep 17 00:00:00 2001 From: Hiro Asari Date: Tue, 6 Dec 2016 13:27:19 -0500 Subject: [PATCH] Add ./node_modules/.bin to $PATH https://github.com/travis-ci/travis-cookbooks/pull/786 removed it, but this broke many Ember-based repositories, so we will reinstate it. This is meant to be a hot fix, which would be reverted after a new set of build images are rolled out. --- lib/travis/build/script/node_js.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/travis/build/script/node_js.rb b/lib/travis/build/script/node_js.rb index 3be8ddde49..89d1fb2014 100644 --- a/lib/travis/build/script/node_js.rb +++ b/lib/travis/build/script/node_js.rb @@ -17,6 +17,7 @@ def export def setup super + prepend_path './node_modules/.bin' convert_legacy_nodejs_config update_nvm nvm_install @@ -212,6 +213,12 @@ def install_yarn sh.echo "Setting up \\$PATH", ansi: :green sh.export "PATH", "$HOME/.yarn/bin:$PATH" end + + def prepend_path(path) + sh.if "$(echo :$PATH: | grep -v :#{path}:)" do + sh.export "PATH", "#{path}:$PATH", echo: true + end + end end end end