mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 22:39:46 +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
|
/// MUST be idempotent, and is run after *all* db migrations
|
||||||
async fn post_up(self, ctx: &RpcContext, input: Value) -> Result<(), Error> {
|
async fn post_up(self, ctx: &RpcContext, input: Value) -> Result<(), Error> {
|
||||||
let path = Path::new(formatcp!("{PACKAGE_DATA}/archive/"));
|
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(
|
return Err(Error::new(
|
||||||
eyre!(
|
eyre!(
|
||||||
"expected path ({}) to be a directory",
|
"expected path ({}) to be a directory",
|
||||||
|
|||||||
Reference in New Issue
Block a user