Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes Generates Duplicate Files in Same Folder #202

Open
Nicholas-Westby opened this issue Jul 19, 2017 · 2 comments
Open

Sometimes Generates Duplicate Files in Same Folder #202

Nicholas-Westby opened this issue Jul 19, 2017 · 2 comments

Comments

@Nicholas-Westby
Copy link

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.

@CrypticGuy
Copy link

Hi @Nicholas-Westby,
I know this is a really old question. But, I am facing this error as well. Any way to resolve it?

@Nicholas-Westby
Copy link
Author

I mentioned a workaround at the bottom of my original post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants