mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-12-22 16:11:38 +03:00
Merge pull request #381 from kinode-dao/dr/wipe-pkg-on-install
fix: delete old /pkg when new one is unzipped to there
This commit is contained in:
commit
c4ea60f12a
@ -253,6 +253,15 @@ pub fn create_package_drive(
|
||||
})?)
|
||||
.send_and_await_response(VFS_TIMEOUT)??;
|
||||
|
||||
// DELETE the /pkg folder in the package drive
|
||||
// in order to replace with the fresh one
|
||||
Request::to(("our", "vfs", "distro", "sys"))
|
||||
.body(serde_json::to_vec(&vfs::VfsRequest {
|
||||
path: drive_name.clone(),
|
||||
action: vfs::VfsAction::RemoveDirAll,
|
||||
})?)
|
||||
.send_and_await_response(VFS_TIMEOUT)??;
|
||||
|
||||
// convert the zip to a new package drive
|
||||
let response = Request::to(("our", "vfs", "distro", "sys"))
|
||||
.body(serde_json::to_vec(&vfs::VfsRequest {
|
||||
|
@ -403,6 +403,8 @@ async fn bootstrap(
|
||||
// create a new package in VFS
|
||||
let our_drive_name = [package_name, package_publisher].join(":");
|
||||
let pkg_path = format!("{}/vfs/{}/pkg", &home_directory_path, &our_drive_name);
|
||||
// delete anything currently residing in the pkg folder
|
||||
fs::remove_dir_all(&pkg_path).await?;
|
||||
fs::create_dir_all(&pkg_path)
|
||||
.await
|
||||
.expect("bootstrap vfs dir pkg creation failed!");
|
||||
|
Loading…
Reference in New Issue
Block a user