From 4078ee09c958df112d81a399a8b1d80226b80488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Kochen?= Date: Mon, 23 Jan 2023 14:48:37 +0100 Subject: [PATCH] Fix up install directories --- src/tmpl/yarn-project.nix.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tmpl/yarn-project.nix.in b/src/tmpl/yarn-project.nix.in index d56a6a1..97cb349 100644 --- a/src/tmpl/yarn-project.nix.in +++ b/src/tmpl/yarn-project.nix.in @@ -151,17 +151,17 @@ let installPhase = '' runHook preInstall - mkdir -p "$out/libexec/$name" "$out/bin" - # Move the package contents to the output directory. if grep -q '"workspaces"' package.json; then # We can't use `yarn pack` in a workspace setup, because it only # packages the outer workspace. + mkdir -p "$out/libexec" mv $PWD "$out/libexec/$name" else # - If the package.json has a `files` field, only files matching those patterns are copied # - Otherwise all files are copied. yarn pack --out package.tgz + mkdir -p "$out/libexec/$name" tar xzvf package.tgz --directory "$out/libexec/$name" --strip-components=1 cp .yarnrc* '@@LOCKFILE@@' "$out/libexec/$name" @@ -180,6 +180,7 @@ let cd "$out/libexec/$name" # Invoke a plugin internal command to setup binaries. + mkdir -p "$out/bin" yarn nixify install-bin $out/bin # A package with node_modules doesn't need the cache