Skip to content

Commit

Permalink
fix(testament): update bash wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Oct 3, 2021
1 parent 8764de0 commit d8b733d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions packages/testament/bin/testament
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/bash
DIR="$( cd "$( dirname "$0" )" &> /dev/null && pwd )"
if [ "$(echo $DIR | grep '.nvm')" ]; then
DIR="$(dirname "$(readlink -f "$0")")"
fi
#!/usr/bin/env bash

/usr/bin/env node --experimental-specifier-resolution=node --loader ts-node/esm node_modules/@thi.ng/testament/cli.js "$@"
# https://stackoverflow.com/a/246128/294515
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"

/usr/bin/env node --no-warnings --experimental-specifier-resolution=node --loader ts-node/esm "$DIR/../cli.js" "$@"

0 comments on commit d8b733d

Please sign in to comment.