[Teton] Add ls and cd commands to rust impl.

This commit is contained in:
Drew Galbraith 2024-08-14 08:47:29 -07:00
parent c155247f1d
commit f5a27156d2
4 changed files with 71 additions and 20 deletions

View file

@ -4,4 +4,22 @@ use core::include;
include!(concat!(env!("OUT_DIR"), "/yunq.rs"));
pub mod dir;
pub mod file;
static mut VFS_CLIENT: Option<VFSClient> = None;
fn get_client() -> &'static mut VFSClient {
unsafe {
if let None = VFS_CLIENT {
let endpoint_cap = yellowstone::from_init_endpoint()
.get_endpoint(&yellowstone::GetEndpointRequest {
endpoint_name: "victoriafalls".to_string(),
})
.expect("Failed to get VFS endpoint");
VFS_CLIENT = Some(VFSClient::new(endpoint_cap.endpoint));
}
VFS_CLIENT.as_mut().unwrap()
}
}