Fix up install directories

This commit is contained in:
Stéphan Kochen
2023-01-23 14:48:37 +01:00
parent d0bed1abaf
commit 4078ee09c9
+3 -2
View File
@@ -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