From 187a9bf7d562eb00113f0a6d95570d6a49f17116 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Thu, 23 Jul 2015 18:19:18 -0700 Subject: [PATCH] Fix running travis on forked repos If we're not on the official repo, link the directory structure around so that go can still find the code. --- .travis.fix-fork.sh | 9 +++++++++ .travis.yml | 3 +++ 2 files changed, 12 insertions(+) create mode 100755 .travis.fix-fork.sh diff --git a/.travis.fix-fork.sh b/.travis.fix-fork.sh new file mode 100755 index 0000000..af26716 --- /dev/null +++ b/.travis.fix-fork.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +if echo $TRAVIS_BUILD_DIR | grep -vq "github.com/google/blueprint$" ; then + cd ../.. + mkdir -p google + mv $TRAVIS_BUILD_DIR google/blueprint + cd google/blueprint + export TRAVIS_BUILD_DIR=$PWD +fi diff --git a/.travis.yml b/.travis.yml index 5b17240..f732e4b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,9 @@ language: go install: - sudo apt-get install ninja-build +before_script: + - source .travis.fix-fork.sh + script: - go test ./... - cp build.ninja.in build.ninja.in.orig