Skip to content

Commit

Permalink
fix extension parsing for workspace naming standard
Browse files Browse the repository at this point in the history
  • Loading branch information
Ant0wan committed May 8, 2023
1 parent 7c12471 commit fbfafe1
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,7 @@ pub fn get_workspace(path: String) -> String {
fn convert_path_to_workspace(path: String) -> String {
let parts: Vec<&str>;

let without_extension = if path.ends_with(".tfvars.json") {
path.trim_end_matches(".tfvars.json").to_string()
} else if path.ends_with(".tfvars") {
path.trim_end_matches(".tfvars").to_string()
} else {
path
};

let without_extension = path.splitn(2, '.').next().unwrap_or(&path);
parts = without_extension.split('/').collect();
println!("{:?}", parts);
// if format.len()
Expand Down

0 comments on commit fbfafe1

Please sign in to comment.