Skip to content

Commit ce96cc1

Browse files
author
jared
committed
Code cleanup
1 parent 38571f8 commit ce96cc1

File tree

3 files changed

+8
-24
lines changed

3 files changed

+8
-24
lines changed

examples/typescript-flake-project/default.nix

Lines changed: 0 additions & 20 deletions
This file was deleted.

flake-lang/typescript/description.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ where
5353
- executes `${name}-npm-extra-dependencies`.
5454
5555
- `packages."${name}-typescript-exe"` is `packages."${name}-typescript"` except
56-
runs `npm install --global --prefix="$out"` for the `installPhase`.
56+
runs `npm install --global --prefix="$out"` for the `installPhase` and
57+
copies some of the symbolic links so that the output makes sense.
5758
5859
- `packages."${name}-typescript-tgz"` is `packages."${name}-typescript"` except
5960
runs `npm pack` after the `buildPhase` to create a tarball of the project in

flake-lang/typescript/flake-typescript.nix

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,12 @@ pkgs.lib.makeExtensible
410410
# A better solution would be to symlink stuff inside the tarballs
411411
# / find a way to tell npm that the dependencies are in the root
412412
# directory in `./.extra-dependencies/*`
413-
mv -f ${pkgs.lib.escapeShellArg npmExtraDependenciesFolder} "$TMPFILE"
414-
rm -rf .gitignore # otherwise, `npm` will ignore the `.extra-dependencies`
415-
cp -Lr "$TMPFILE" ${pkgs.lib.escapeShellArg npmExtraDependenciesFolder}
413+
if [ -e ${pkgs.lib.escapeShellArg npmExtraDependenciesFolder} ]
414+
then
415+
mv -f ${pkgs.lib.escapeShellArg npmExtraDependenciesFolder} "$TMPFILE"
416+
rm -rf .gitignore # otherwise, `npm` will ignore the `.extra-dependencies`
417+
cp -Lr "$TMPFILE" ${pkgs.lib.escapeShellArg npmExtraDependenciesFolder}
418+
fi
416419
417420
mkdir -p "$out/tarballs"
418421
npm pack --pack-destination "$out/tarballs"

0 commit comments

Comments
 (0)