Skip to content

Commit

Permalink
feat: adding env files to files it ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
benfdking committed May 22, 2024
1 parent f5646ef commit 748c043
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion rust/core/src/onboarding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ pub async fn generate_source_files(
/// - hidden files
/// - .sqlite files
/// - .git folder
/// - .idea folder
/// - .env files
pub async fn is_empty_bar_hidden_and_sqlite(
file_system: &impl FileSystem,
root_path: &str,
Expand All @@ -161,8 +163,9 @@ pub async fn is_empty_bar_hidden_and_sqlite(
let is_sqlite = path.extension().map(|ext| ext == "sqlite").unwrap_or(false);
let is_git = file_path.contains(".git/");
let is_jetbrains = file_path.contains(".idea/");
let is_env = file_path.ends_with(".env");

is_hidden || is_sqlite || is_git || is_jetbrains
is_hidden || is_sqlite || is_git || is_jetbrains || is_env
});

Ok(is_empty)
Expand Down Expand Up @@ -290,6 +293,13 @@ mod tests {
contents: Bytes::from("".as_bytes()),
},
),
(
"/.env".to_string(),
File {
name: ".env".to_string(),
contents: Bytes::from("".as_bytes()),
},
),
]),
};

Expand Down

0 comments on commit 748c043

Please sign in to comment.