Skip to content

Commit 63133f9

Browse files
committed
Also fixed issue with paths for 'dist' and 'public'
1 parent 6d80f6d commit 63133f9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

utils.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,12 @@ func IsBuildFolder(path string) bool {
262262

263263
// check for the `dist` folder
264264
func IsDistFolder(path string) bool {
265-
if strings.Contains(path, string(os.PathSeparator)+"dist") {
265+
// checks for the "dist" folder itself, i.e. for a path that ends with `/dist`
266+
// ... or for files within the "dist" folder, i.e. for a path that contains `/dist/`
267+
distFolderPath := string(os.PathSeparator) + "dist"
268+
fileInDistFolderPath := distFolderPath + string(os.PathSeparator)
269+
270+
if strings.HasSuffix(path, distFolderPath) || strings.Contains(path, fileInDistFolderPath) {
266271
if !didPrintDistMsg {
267272
log.Info("\tIgnoring `dist` folder")
268273
didPrintDistMsg = true
@@ -276,7 +281,12 @@ func IsDistFolder(path string) bool {
276281

277282
// check for the `public` folder
278283
func IsPublicFolder(path string) bool {
279-
if strings.Contains(path, string(os.PathSeparator)+"public") {
284+
// checks for the "dist" folder itself, i.e. for a path that ends with `/dist`
285+
// ... or for files within the "dist" folder, i.e. for a path that contains `/dist/`
286+
publicFolderPath := string(os.PathSeparator) + "public"
287+
fileInPublicFolderPath := publicFolderPath + string(os.PathSeparator)
288+
289+
if strings.HasSuffix(path, publicFolderPath) || strings.Contains(path, fileInPublicFolderPath) {
280290
if !didPrintPublicMsg {
281291
log.Info("\tIgnoring `build` folder")
282292
didPrintPublicMsg = true

0 commit comments

Comments
 (0)