From 6e898901fd9d785bbe4b6a52d5903bab05ad847e Mon Sep 17 00:00:00 2001 From: Jakob Asslaender Date: Wed, 30 Nov 2022 20:26:51 -0500 Subject: [PATCH] bugfix --- .github/workflows/CI_ubuntu.yml | 4 +--- src/BartIO.jl | 17 ++++++++--------- test/testIO.jl | 2 +- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/CI_ubuntu.yml b/.github/workflows/CI_ubuntu.yml index 9c48a32..31ddf60 100644 --- a/.github/workflows/CI_ubuntu.yml +++ b/.github/workflows/CI_ubuntu.yml @@ -15,7 +15,7 @@ jobs: os: - ubuntu-latest arch: - - x64 + - x64 steps: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@v1 @@ -44,8 +44,6 @@ jobs: pwd ls -l bart ./bart version - - run: | - pip install numpy - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v1 diff --git a/src/BartIO.jl b/src/BartIO.jl index 4db40cb..7837a30 100644 --- a/src/BartIO.jl +++ b/src/BartIO.jl @@ -18,16 +18,15 @@ function set_bart_path(pathToBart::String) end function get_bart_path() - # Check bart toolbox path - bart_path = ENV["TOOLBOX_PATH"] - if isempty(bart_path) - if isfile("/usr/local/bin/bart") - bart_path = "/usr/local/bin" - elseif isfile("/usr/bin/bart") - bart_path = "/usr/bin" - end + if haskey(ENV, "TOOLBOX_PATH") + return ENV["TOOLBOX_PATH"] + elseif isfile("/usr/local/bin/bart") + return "/usr/local/bin" + elseif isfile("/usr/bin/bart") + return "/usr/bin" + else + return nothing end - return bart_path end """ diff --git a/test/testIO.jl b/test/testIO.jl index f472062..7d241f2 100644 --- a/test/testIO.jl +++ b/test/testIO.jl @@ -24,7 +24,7 @@ end @testset "BART" begin - if isempty(ENV["TOOLBOX_PATH"]) + if !haskey(ENV, "TOOLBOX_PATH") || isempty(ENV["TOOLBOX_PATH"]) pathtobart = Sys.isapple() ? "/Users" : "/home" pathtobart *= "/runner/work/BartIO.jl/BartIO.jl/bart" set_bart_path(pathtobart)