Skip to content

Commit

Permalink
Use pnpm if a pnpm-lock.yaml file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Aug 16, 2023
1 parent ad02e7b commit bfb30b0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions frameworks/src/ts/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ pub fn install_node_modules(context: &LightContext) -> Result<()> {
return Ok(());
}

// smoelius: If a `yarn.lock` file exists, use `yarn`. Otherwise, default to `npm install`.
let mut command = if context.root.join("yarn.lock").try_exists()? {
// smoelius: If a `pnpm-lock.yaml` file exists, use `pnpm install`. If a `yarn.lock` file
// exists, use `yarn`. If neither exist, default to `npm install`.
let mut command = if context.root.join("pnpm-lock.yaml").try_exists()? {
let mut command = Command::new("pnpm");
command.arg("install");
command
} else if context.root.join("yarn.lock").try_exists()? {
Command::new("yarn")
} else {
let mut command = Command::new("npm");
Expand Down

0 comments on commit bfb30b0

Please # to comment.