Skip to content

Commit

Permalink
fix: gh cleanup-notifications can be run from any directory
Browse files Browse the repository at this point in the history
Without this, when run outside of the project directory, an error was
raised because `index.js` was specified incorrectly:

```
$ gh cleanup-notifications --verbose --dry-run | ts
node:internal/modules/cjs/loader:1222
  throw err;
  ^

Error: Cannot find module '/Users/andrewendt/index.js
```
  • Loading branch information
awendt committed Nov 14, 2024
1 parent 3ae2366 commit e4ac940
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gh-cleanup-notifications
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ if ! type -p node >/dev/null; then
exit 1
fi

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

export GITHUB_TOKEN=$(gh auth token)

exec node index.js "$@"
exec node ${SCRIPT_DIR}/index.js "$@"

0 comments on commit e4ac940

Please sign in to comment.