Skip to content

Commit

Permalink
Merge pull request #4 from Ant0wan/workspace-formatter
Browse files Browse the repository at this point in the history
fix extension parsing for workspace naming standard
  • Loading branch information
Ant0wan authored May 9, 2023
2 parents 2d35aad + fbfafe1 commit 809042e
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 809042e

Please sign in to comment.