mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-25 18:33:24 +00:00
Enhance OSDK performance by reusing existing base, bundle and build
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
3bbdc68d39
commit
858e95ed4d
@ -83,12 +83,11 @@ impl AsterBin {
|
||||
self.stripped
|
||||
}
|
||||
|
||||
/// Move the binary to the `base` directory and convert the path to a relative path.
|
||||
pub fn move_to(self, base: impl AsRef<Path>) -> Self {
|
||||
/// Copy the binary to the `base` directory and convert the path to a relative path.
|
||||
pub fn copy_to(self, base: impl AsRef<Path>) -> Self {
|
||||
let file_name = self.path.file_name().unwrap();
|
||||
let copied_path = base.as_ref().join(file_name);
|
||||
fs::copy(&self.path, copied_path).unwrap();
|
||||
fs::remove_file(&self.path).unwrap();
|
||||
Self {
|
||||
path: PathBuf::from(file_name),
|
||||
arch: self.arch,
|
||||
|
Reference in New Issue
Block a user