From 36abd2fd63f8398350b67f23fd521a5ef5065445 Mon Sep 17 00:00:00 2001 From: Yohe-Am <56622350+Yohe-Am@users.noreply.github.com> Date: Tue, 2 Jan 2024 08:47:27 +0000 Subject: [PATCH] fix: config loading --- install/mod.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/install/mod.ts b/install/mod.ts index 8ee500e9..5361f775 100644 --- a/install/mod.ts +++ b/install/mod.ts @@ -197,15 +197,19 @@ export async function install( exePath, `#!/bin/sh GHJK_DIR="$\{GHJK_DIR:-${ghjkDir}}" DENO_DIR="$\{GHJK_DENO_DIR:-${denoCacheDir}}" -cur_dir=$PWD +curDir=$PWD while [ "$cur_dir" != "/" ]; do if [ -f "$cur_dir/ghjk.ts" ]; then - export GHJK_CONFIG="$cur_dir/ghjk.ts" + foundConfig="$cur_dir/ghjk.ts" localLockFile="$cur_dir/ghjk.deno.lock" + break fi # recursively look in parent directory - cur_dir="$(dirname "$cur_dir")" + curDir="$(dirname "$curDir")" done + +GHJK_CONFIG="$\{GHJK_CONFIG:-foundConfig}" + if [ -n "\${localLockFile+x}" ]; then lockFlag="--lock $localLockFile" else