Skip to content

Commit

Permalink
commit package-lock.json as well
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinMalfait committed Aug 9, 2024
1 parent daba733 commit 869f7c2
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,12 +635,17 @@ async fn main() -> Result<()> {
},
)?;

// Commit the `package.json` file
repo.add(pwd_str)?.commit(&format!(
"{} - {}",
&version,
&package.name()
))?;
// Add the `package-lock.json` file
let pkg_lock = pwd.join("package-lock.json");
if pkg_lock.exists() {
repo.add(pkg_lock.to_str().unwrap())?;
}

// Add the `package.json` file
repo.add(pwd.join("package.json").to_str().unwrap())?;

// Commit
repo.commit(&format!("{} - {}", &version, &package.name()))?;

// Generate a tag
repo.tag(&format!("{}@v{}", &package.name(), &version))?;
Expand Down Expand Up @@ -683,7 +688,13 @@ async fn main() -> Result<()> {
},
)?;

// Add the package.json
// Add the `package-lock.json` file
let pkg_lock = pwd.join("package-lock.json");
if pkg_lock.exists() {
repo.add(pkg_lock.to_str().unwrap())?;
}

// Add the `package.json` file
repo.add(pwd.join("package.json").to_str().unwrap())?;

// Commit the version
Expand Down

0 comments on commit 869f7c2

Please sign in to comment.