From f5b566f93c31a19f0b849e21c323fe132ab3b0f3 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Sat, 27 May 2017 22:44:03 +0000 Subject: [PATCH] Support passing pkg in the envirorment --- nix-debug-shell | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/nix-debug-shell b/nix-debug-shell index 2a12d5a..c4fb015 100755 --- a/nix-debug-shell +++ b/nix-debug-shell @@ -5,11 +5,20 @@ dir=$(dirname $(readlink -f "$0")) declare -a args for arg in "$@"; do + case "$arg" in + --no-ccache) + noCCache=1 + ;; + *) + args+=("$arg") + esac + if [ -n "$nextArgIsPkg" ]; then pkg="$arg" nextArgIsPkg= continue fi + case "$arg" in -A) if [ -n "$pkg" ]; then @@ -18,11 +27,6 @@ for arg in "$@"; do fi nextArgIsPkg=1 ;; - --no-ccache) - noCCache=1 - ;; - *) - args+=("$arg") esac done @@ -43,4 +47,4 @@ fi mkdir -p "$buildDir" #echo "noCCache: $noCCache, pkg: $pkg, args: ${args[@]}" -nix-shell -A "$pkg" --command "cd $buildDir; source $dir/env.sh; return" "${args[@]}" +nix-shell --command "cd $buildDir; source $dir/env.sh; return" "${args[@]}"