Skip to content

Sometimes Generates Duplicate Files in Same Folder #202

@Nicholas-Westby

Description

@Nicholas-Westby

I'm using grunt-contrib-compress as part of my build process to generate a ZIP file that contains all the files necessary for a website deployment. I was tinkering with a few settings, and I noticed this in one of the folders in the generated ZIP file:

duplicate

The web.config file is in that folder twice. Keep in mind this is on a Windows machine, so (outside of a ZIP file) it's not even possible to have two files of the same name in the same folder, even if they have different casing (in this instance, the case is identical).

I'm using grunt-contrib-compress 1.4.3. Here's my configuration from my gruntfile.js:

compress: {
    main: {
        options: {
            archive: "../dist/<%= config.projectName %>_" + currentDate() + ".zip"
        },
        files: [
            {
                src: [
                    "**/*",
                    "!*.csproj",
                    "!*.csproj.user",
                    "!Web.config",
                    "!web.config",
                    "!web.sample.config",
                    "**/media/Web.config",
                    "**/Views/Web.config",
                    "!unhandled-error-*.html",
                    "!unhandled-error-*.json",
                    "!Config/*.sample.config",
                    "!Config/umbracoSettings.config",
                    "!Properties/*.cs",
                    "!obj/**",
                    "!App_Data/TEMP/**",
                    "!App_Data/MediaIndexSet/**",
                    "!App_Data/Logs/**",
                    "!App_Data/cache/**",
                    "!App_Data/umbraco.config",
                    "!App_Data/Formulate/**",
                    "!App_Data/NuGetBackup/**",
                    "!media/*/**",
                    "!Media/*/**",
                    "!styles/*.css.map",
                    "!**/.gitignore",
                    "!**/Thumbs.db",
                    "!packages.config"
                ],
                dest: "/",
                expand: true,
                cwd: "<%= config.projectDir %>/"
            }
        ]
    }
}

Note that if I change the line that says "**/media/Web.config" to "**/Media/Web.config" (i.e., I uppercased the "M"), the duplicate file is no longer there (i.e., it's just a single web.config). On the actual file system, the original folder has an uppercase "M". Note that I also tried adding both of those lines (i.e., both with uppercase and lowercase), and I still ended up with the duplicate web.config files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions