feat: add @generated to lockfiles

Adds the @generated marker to lockfiles to make
them easily recognizable as auto-generated.
This commit is contained in:
daimond113 2025-03-09 16:16:44 +01:00
parent e6ee935c11
commit 292565b647
No known key found for this signature in database
GPG key ID: 640DC95EC1190354
2 changed files with 9 additions and 2 deletions

View file

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Binary linkers are now done in Rust to simplify their implementation and cross-runtime portability by @daimond113
- Show available targets in add and install commands if the specifier hasn't matched any by @daimond113
- Add [@generated](https://generated.at/) marker to lockfiles by @daimond113
## [0.6.0] - 2025-02-22
### Added

View file

@ -251,8 +251,14 @@ impl Project {
&self,
lockfile: &Lockfile,
) -> Result<(), errors::LockfileWriteError> {
let string = toml::to_string(lockfile)?;
fs::write(self.package_dir().join(LOCKFILE_FILE_NAME), string).await?;
let lockfile = toml::to_string(lockfile)?;
let lockfile = format!(
r"# This file is automatically @generated by pesde.
# It is not intended for manual editing.
{lockfile}"
);
fs::write(self.package_dir().join(LOCKFILE_FILE_NAME), lockfile).await?;
Ok(())
}