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

feat: adding env files to files it ignores #268

Merged
merged 1 commit into from
May 22, 2024
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
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
Loading