From 087a315289924ee9694c5f0692aa00da886f48ae Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Wed, 22 Aug 2018 17:17:06 +0100 Subject: [PATCH] Fix build-run and build-debug functions --- build/build.plugin.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build/build.plugin.zsh b/build/build.plugin.zsh index 2688f7d..5a1510b 100644 --- a/build/build.plugin.zsh +++ b/build/build.plugin.zsh @@ -33,7 +33,7 @@ build-dir() { python $_build_dir_py $file; local error=$? # If the file exists, read the build directory from it, then delete it. - [ -f $file ] && build_dir=$PWD/`cat $file`; rm $file + [ -f $file ] && local build_dir=$PWD/`cat $file`; rm $file # If choosing a build directory failed, return that error. [[ "$error" = "0" ]] || return $error # If `build.ninja` exists in alias `ninja`, return. @@ -59,14 +59,14 @@ build-dir() { [[ "$1" = "--build" ]] && eval $build || true } -# Build then run a target residing in `$build_dir/bin`. +# Build then run a target residing in `~build/bin`. build-run() { local target=$1; shift 1 - build $target && $build_dir/bin/$target $* + eval build $target && ~build/bin/$target $* } -# Build then debug a target residing in `$build_dir/bin`. +# Build then debug a target residing in `~build/bin`. build-debug() { local target=$1; shift 1 - build $target && debug $build_dir/bin/$target $* + eval build $target && debug ~build/bin/$target $* }