luaur-cli-lib 0.1.1

Shared CLI helpers for the luaur tools.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::enums::navigation_status::NavigationStatus;
use crate::functions::normalize_path::normalize_path;
use crate::records::vfs_navigator::VfsNavigator;

impl VfsNavigator {
    pub fn to_child(&mut self, name: &str) -> NavigationStatus {
        if name == ".config" {
            return NavigationStatus::NotFound;
        }

        self.module_path = normalize_path(&format!("{}/{}", self.module_path, name));
        self.absolute_module_path =
            normalize_path(&format!("{}/{}", self.absolute_module_path, name));

        self.update_real_paths()
    }
}