Skip to content

Commit 394741a

Browse files
author
jared
committed
Improved error messages for typescriptFlake
1 parent ee54d24 commit 394741a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

flake-lang/typescript/flake-typescript.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ pkgs.lib.makeExtensible
120120
121121
if ! node2nix --input ./package.json --lock ./package-lock.json --development --node-env "$NIX_NODE_ENV_FILE" --output "$NIX_NODE_PACKAGES_FILE" --composition "$NIX_COMPOSITION_FILE"
122122
then
123-
1>&2 echo 'ERROR: `node2nix` failed.'
123+
1>&2 echo 'flake-lang.nix: error: `node2nix` failed.'
124124
1>&2 echo 'Some of the following may fix your problem:'
125125
1>&2 echo ' - (Re)create a `./package-lock.json` with lockfile version 2 by running:'
126126
1>&2 echo ' npm install --package-lock-only --lockfile-version 2 '
@@ -251,8 +251,10 @@ pkgs.lib.makeExtensible
251251
252252
export NODE_PATH=${pkgs.lib.escapeShellArg "${npmPackage}/lib/node_modules/${srcWithNode2nixIfd.args.packageName}/node_modules"}
253253
254-
echo 'Removing existing `node_modules`, and creating a symbolic link named `node_modules` pointing to `$NODE_PATH`'
254+
[[ -e node_modules ]] && echo 'flake-lang.nix: removing existing `node_modules`'
255255
rm -rf node_modules
256+
257+
echo 'flake-lang.nix: creating a symbolic link named `node_modules` pointing to `$NODE_PATH`'
256258
ln -sf "$NODE_PATH" node_modules
257259
258260
${devShellHook}

0 commit comments

Comments
 (0)