From 3a2bf98c4ec21a53401633889c2f95d60c0faf63 Mon Sep 17 00:00:00 2001 From: Sean Young <sean.young@monax.io> Date: Thu, 23 Aug 2018 13:52:18 +0100 Subject: [PATCH] Fix compiling solidity from a different directory Signed-off-by: Sean Young <sean.young@monax.io> --- deploy/run_package.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/deploy/run_package.go b/deploy/run_package.go index c5cb325f..2a081e81 100644 --- a/deploy/run_package.go +++ b/deploy/run_package.go @@ -64,11 +64,12 @@ func RunPackage(do *def.Packages) error { } // Ensure relative paths if we're given a different path for deploy contracts jobs + // Solidity contracts may import other solidity contracts, and the working directory + // is the directory where solc searches from. if do.Path != pwd { - for _, job := range do.Package.Jobs { - if job.Deploy != nil { - job.Deploy.Contract = filepath.Join(do.Path, job.Deploy.Contract) - } + err = os.Chdir(do.Path) + if err != nil { + return err } } -- GitLab