Skip to content

Commit 6d80f6d

Browse files
committed
Fixed issue with 'build' folder check where e.g. 'building' would also trigger it
1 parent f84fd6b commit 6d80f6d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

sample-projects/sample-node-project/building/something.js

Whitespace-only changes.

utils.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,12 @@ func IsDb(path string) bool {
243243

244244
// check for the `build` folder
245245
func IsBuildFolder(path string) bool {
246-
if strings.Contains(path, string(os.PathSeparator)+"build") {
246+
// checks for the "build" folder itself, i.e. for a path that ends with `/build`
247+
// ... or for files within the "build" folder, i.e. for a path that contains `/build/`
248+
buildFolderPath := string(os.PathSeparator) + "build"
249+
fileInBuildFolderPath := buildFolderPath + string(os.PathSeparator)
250+
251+
if strings.HasSuffix(path, buildFolderPath) || strings.Contains(path, fileInBuildFolderPath) {
247252
if !didPrintBuildMsg {
248253
log.Info("\tIgnoring `build` folder")
249254
didPrintBuildMsg = true
@@ -288,6 +293,8 @@ func IsIdeFolder(path string) bool {
288293
idePaths := [2]string{".vscode", ".idea"}
289294

290295
for _, element := range idePaths {
296+
// NOTE: This check should be fine using "Contains" because I don't expect these IDE folder names to be used for
297+
// anything useful (i.e., I don't anticipate a folder name with ".idea" in its name to contain anything useful)
291298
if strings.Contains(path, string(os.PathSeparator)+element) {
292299
if !didPrintIdesMsg {
293300
log.Info("\tIgnoring IDE folder (such as .code, .idea)")

0 commit comments

Comments
 (0)