Skip to content

Commit

Permalink
fix: config loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohe-Am committed Jan 2, 2024
1 parent e22ce83 commit 36abd2f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions install/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 36abd2f

Please sign in to comment.