mirror of https://github.com/buster-so/buster.git
Merge pull request #636 from buster-so/fix-env-copy-script
Fix-env-copy-script
This commit is contained in:
commit
645cadd7c9
|
@ -95,17 +95,22 @@ async function findEnvFiles(dir: string, baseDir: string = dir): Promise<string[
|
||||||
const fullPath = join(currentDir, entry.name);
|
const fullPath = join(currentDir, entry.name);
|
||||||
const relativePath = relative(baseDir, fullPath);
|
const relativePath = relative(baseDir, fullPath);
|
||||||
|
|
||||||
// Check if this path is ignored
|
|
||||||
if (isIgnored(fullPath, gitignoreStack)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entry.isDirectory()) {
|
if (entry.isDirectory()) {
|
||||||
// Always skip .git directory
|
// Always skip .git directory
|
||||||
if (entry.name === '.git') continue;
|
if (entry.name === '.git') continue;
|
||||||
|
// Check if directory is ignored
|
||||||
|
if (isIgnored(fullPath, gitignoreStack)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
await walkDir(fullPath, gitignoreStack);
|
await walkDir(fullPath, gitignoreStack);
|
||||||
} else if (entry.name.startsWith('.env')) {
|
} else if (entry.name.startsWith('.env') && !entry.name.endsWith('.example')) {
|
||||||
|
// Always include .env files (but not .env.example), regardless of gitignore rules
|
||||||
envFiles.push(relativePath);
|
envFiles.push(relativePath);
|
||||||
|
} else {
|
||||||
|
// For non-.env files, check if they're ignored
|
||||||
|
if (isIgnored(fullPath, gitignoreStack)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
Loading…
Reference in New Issue