mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-27 06:52:35 -04:00

Nuxt 2 fails with aliases in serverMiddleware, so I had to use tsconfig-paths-webpack-plugin as workaround https://github.com/nuxt/typescript/issues/339
17 lines
530 B
Bash
Executable File
17 lines
530 B
Bash
Executable File
#!/bin/bash
|
|
# wrapper for external contexts (cronjob, supervisor) which have no access to nvm to
|
|
# use the correct node version and execute node scripts
|
|
|
|
cd "$(dirname "$0")" || exit
|
|
|
|
nvm_bin=~/.nvm/versions/node/"$(<.nvmrc)"/bin
|
|
export PATH=$nvm_bin:$PATH
|
|
bin_file=./node_modules/.bin/"$1"
|
|
if [ -f "$bin_file" ]; then
|
|
# directly call bin files when possible to have no pnpm startup cost
|
|
NODE_OPTIONS="-r tsconfig-paths/register" exec "$bin_file" "${@:2}"
|
|
else
|
|
# call through pnpm in other cases
|
|
exec pnpm "$@"
|
|
fi
|