Skip to content

Commit

Permalink
select correct npm or pnpm backend
Browse files Browse the repository at this point in the history
  • Loading branch information
tanneberger committed Sep 30, 2023
1 parent 4efe48f commit 9b18261
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/package/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use std::{env, io};
use crate::args::BuildSystem::{CMake, Cargo, LFC};
use crate::util::errors::{BuildResult, LingoError};
use git2::Repository;
use which::which;

fn is_valid_location_for_project(path: &std::path::Path) -> bool {
!path.join("src").exists() && !path.join(".git").exists() && !path.join("application").exists()
Expand Down Expand Up @@ -93,6 +94,13 @@ impl App {
match self.target {
TargetLanguage::Cpp => CMake,
TargetLanguage::Rust => Cargo,
TargetLanguage::TypeScript => {
if which("pnpm").is_ok() {
BuildSystem::Pnpm
} else {
BuildSystem::Npm
}
}
_ => LFC,
}
}
Expand Down

0 comments on commit 9b18261

Please sign in to comment.