Skip to content

Commit

Permalink
refactor path to run from root
Browse files Browse the repository at this point in the history
  • Loading branch information
tnn4 committed May 7, 2023
1 parent 522ec00 commit 6eca522
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion poke-rs-api/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ async fn pokeapi_endpoint(

let file_name = format!("{}.json", _id2);
// location to look for file
let file_name_location = format!("../pokeapi-cache/{}/{}.json", _endpoint,_id2);
// Now should run at root
let file_name_location = format!("pokeapi-cache/{}/{}.json", _endpoint,_id2);
#[cfg(debug_assertions)]
{
println!("file_name_location: {}", file_name_location);
Expand Down
7 changes: 6 additions & 1 deletion poke-rs-api/src/pkmn/mapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,13 @@ pub enum PkmnEnum {
Pikachu = 25,
}

// INIT
pub fn init_mapping(_endpoint:&str) -> /*HashMap<String,String>*/toml::Table {
let file_path=format!("../mappings/{}2id.toml",_endpoint);
let file_path=format!("mappings/{}2id.toml",_endpoint);

#[cfg(debug_assertions)]
println!("mapping file: {}", &file_path);

let mut toml_object: toml::Table = Default::default();
assert!(std::path::Path::new(file_path.as_str()).exists());

Expand Down

0 comments on commit 6eca522

Please sign in to comment.