Fix install for projects with workspaces
This commit is contained in:
@@ -154,8 +154,13 @@ let
|
||||
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.
|
||||
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
|
||||
# - Otherwise all files are copied.
|
||||
yarn pack --out package.tgz
|
||||
tar xzvf package.tgz --directory "$out/libexec/$name" --strip-components=1
|
||||
|
||||
@@ -170,6 +175,7 @@ let
|
||||
# Otherwise, assume PnP. Copy the loader into the package.
|
||||
cp .pnp.* "$out/libexec/$name"
|
||||
fi
|
||||
fi
|
||||
|
||||
cd "$out/libexec/$name"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user