bdkjones / CodeKit2

CodeKit 2 Beta
97 stars 4 forks source link

Ignored files will sometimes forget they've been ignored and re-compile #373

Open jbrooksuk opened 10 years ago

jbrooksuk commented 10 years ago

I've added the root of my project to a Codekit project, then told it to ignore some directories and only monitor what's in the public directory which contains the usual:

Inside my javascripts directory I have one master JS file called application.js this is basically:

// @codekit-append "vendor/jquery.js"
// @codekit-append "vendor/ZeroClipboard.min.js"
// @codekit-append "vendor/selectize.js"
// @codekit-append "vendor/mailcheck.min.js"
// @codekit-append "vendor/moment.js"
// ...

And is the only file that I want to compile (at least append the files to). It outputs to application.min.js. Every other file is explicitly told not to output anything. However every now and then if I touch one of the files it'll reset the setting and minify it.

Please please please fix this. It's driving me insane. I keep accidentally committing these minified files which we don't want.

I'm on OSX 10.9.3, running CodeKit 2.0.6 with Google Chrome, Sublime Text 3, Git, Homebrew (want more?) :wink:

bdkjones commented 10 years ago

Are you pulling down from a repo? If so, what's likely going on is that when you pull changes, you're also pulling a new copy of the config.codekit file that contains the settings for all files in your project. The remote copy of that config file probably has different output settings for the JS files in question. When you pull it down, CodeKit immediately applies the new config file to the entire project (which is exactly what it should do; that's how settings sync across Macs and teams).

Verify that this is not the case.

jbrooksuk commented 10 years ago

Yeah, I'm doing a pull from Git, however Codekit will still forget my settings even if I didn't just pull.

Your suggestion makes perfect sense, but unfortunately the codekit.config file is in our .gitignore file.

bdkjones commented 10 years ago

Okay. Next up, what editor are you using to save the files?

jbrooksuk commented 10 years ago

Sublime Text 3 (3059). My project is local, so there is no Samba configuration stuff going on.

bdkjones commented 10 years ago

Okay. It’s not the editor.

Are there any other tools/apps on your system that are watching these files or changing them? Build scripts, etc? Do these files get changed when you perform Git actions?

On 17 Jun 2014, at 12:25, James Brooks notifications@github.com wrote:

Sublime Text 3 (3059). My project is local, so there is no Samba configuration stuff going on.

— Reply to this email directly or view it on GitHub.

jbrooksuk commented 10 years ago

I have usual Apache OSX (with some homebrew changes) setup. I have a git hook for when composer.lock changes, it'll auto composer update. Other than that, nothing.

bdkjones commented 10 years ago

Is that hook modifying these files? The issue is that if something changes the files in a certain way, the operating system detects that change as "new file created" rather than "existing file updated" and when this happens, CodeKit is going to apply the starting defaults for new Javascript files rather than use the settings for the "old" file that was deleted and replaced. The starting default value is to create an output file.

That said, if these files are prepended/appended into another, the app should automatically be marking them as NOT producing an output file (that line in the inspector should be unchecked).

jbrooksuk commented 10 years ago

The git hook is just running composer update, so it won't be touching anything in my public directory.

Not all of the files get minified, some are just plain JavaScript files which are needed for some pages and are included adhoc.