mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
ignore missing package archive on 035 migration
This commit is contained in:
@@ -277,7 +277,12 @@ impl VersionT for Version {
|
||||
/// MUST be idempotent, and is run after *all* db migrations
|
||||
async fn post_up(self, ctx: &RpcContext, input: Value) -> Result<(), Error> {
|
||||
let path = Path::new(formatcp!("{PACKAGE_DATA}/archive/"));
|
||||
if !path.is_dir() {
|
||||
let metadata = tokio::fs::metadata(path).await;
|
||||
if metadata.is_err() {
|
||||
// Treat non-existent archive directory as empty
|
||||
return Ok(());
|
||||
}
|
||||
if !metadata.unwrap().is_dir() {
|
||||
return Err(Error::new(
|
||||
eyre!(
|
||||
"expected path ({}) to be a directory",
|
||||
|
||||
Reference in New Issue
Block a user