Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix extension parsing for workspace naming standard #4

Merged
merged 1 commit into from
May 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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