Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/commands/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,10 @@ fn target_installation(
target: config.target().to_string(),
},
installed_at: chrono::Utc::now().timestamp(),
midenup_version: Some(
semver::Version::parse(env!("CARGO_PKG_VERSION"))
.expect("CARGO_PKG_VERSION is always valid semver"),
),
})
}

Expand Down
1 change: 1 addition & 0 deletions src/migrate_v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ pub fn migrate_if_needed(home: &Path) -> Result<MigrationOutcome, MigrationError
components: Vec::new(),
publication: PublicationRef::NeedsReinstall,
installed_at,
midenup_version: None,
});
}

Expand Down
1 change: 1 addition & 0 deletions src/publish/journal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ mod tests {
target: "aarch64-apple-darwin".to_string(),
},
installed_at: 1735689600,
midenup_version: None,
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/publish/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ mod tests {
target: "aarch64-apple-darwin".to_string(),
},
installed_at: 1735689600,
midenup_version: None,
});

assert_eq!(
Expand Down Expand Up @@ -426,6 +427,7 @@ mod tests {
target: "aarch64-apple-darwin".to_string(),
},
installed_at: 1735689600,
midenup_version: None,
},
);
journal::prepare(home, &entry).unwrap();
Expand Down
3 changes: 3 additions & 0 deletions src/state/installation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ pub struct Installation {
pub publication: PublicationRef,
/// UTC epoch seconds.
pub installed_at: i64,
/// The midenup version that produced this installation's on-disk layout.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub midenup_version: Option<semver::Version>,
}

impl Installation {
Expand Down
1 change: 1 addition & 0 deletions src/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ mod tests {
target: "aarch64-apple-darwin".to_string(),
},
installed_at: 1735689600,
midenup_version: None,
}],
}
}
Expand Down
Loading