@@ -262,7 +262,12 @@ func IsBuildFolder(path string) bool {
262262
263263// check for the `dist` folder
264264func 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 ("\t Ignoring `dist` folder" )
268273 didPrintDistMsg = true
@@ -276,7 +281,12 @@ func IsDistFolder(path string) bool {
276281
277282// check for the `public` folder
278283func 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 ("\t Ignoring `build` folder" )
282292 didPrintPublicMsg = true
0 commit comments