bdkjones / CodeKit2

CodeKit 2 Beta
97 stars 4 forks source link

Feature request: compile timestamp #546

Open macfire opened 9 years ago

macfire commented 9 years ago

It would be very useful to have the option to include a timestamp to a file when it is compiled -- written as comment or assignable to a variable ( .js or .kit).

Many times when we have clients proof a project on our dev server, we are not always sure their browsers are loading latest files or cached files. With a timestamp, we could easily verify.

If this is not a feature you'd consider including in CodeKit, would this be a good case for using "Hooks"?

bdkjones commented 9 years ago

Hmm. An interesting idea. You could write a Hook that opens the output file, prepends a commented-timestamp to the top and then saves the file. The next update to the app will have a way to retrieve the output file paths in a Hook. I expect to have this update out tomorrow.

On 20 Apr 2015, at 16:15, MediaFuse notifications@github.com wrote:

It would be very useful to have the option to include a timestamp to a file when it is compiled -- written as comment or assignable to a variable ( .js or .kit).

Many times when we have clients proof a project on our dev server, we are not always sure their browsers are loading latest files or cached files. With a timestamp, we could easily verify.

If this is not a feature you'd consider including in CodeKit, would this be a good case for using "Hooks"?

— Reply to this email directly or view it on GitHub https://github.com/bdkjones/CodeKit/issues/546.

subhaze commented 9 years ago

@macfire @bdkjones Made a quick write-up on adding a timestamp to files that CodeKit creates using the new ENV vars available in hooks, hope this helps!

http://useless.today/codekit-timestamps/

macfire commented 9 years ago

@bdkjones Thank you for making the output paths available in a hook.

@subhaze Thank you for example timestamp implementation. Unfortunately I haven't been able to get it to work. I'm not very familiar with using bash, so I've not yet determined my error. I'll post when I find a solution.

subhaze commented 9 years ago

@macfire Interesting... I'll double check it later this evening, thanks for the heads up.

macfire commented 9 years ago

@subhaze Good news: I now have it working. I had to upgrade twice ... first to CodeKit 2.3, then to CodeKit 2.3.1

Thanks again to @bdkjones and @subhaze

bdkjones commented 9 years ago

Yea, Git screwed up a merge on my repository, so some things got corrupted and shipped without me knowing. I had to reissue the 2.3.1 update. You should be running build 18904. Make sure you are, as older builds won't properly check for future updates.

Sent from my iPhone

On Apr 27, 2015, at 13:56, MediaFuse notifications@github.com wrote:

@subhaze Good news: I now have it working. I had to upgrade twice ... first to CodeKit 2.3, then to CodeKit 2.3.1

Thanks again to @bdkjones and @subhaze

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

macfire commented 9 years ago

Yes, I'm now running build 18904.

macfire commented 9 years ago

Tip for other newbies like myself: Enclose paths variable in quotes if your path names have spaces.

"${CK_OUTPUT_PATHS//:/}"
subhaze commented 9 years ago

@macfire I just updated the bash script in that post, I forgot the ' ' after -i which will cause a backup of your css to be saved with '-e' at the end. Sigh... good o'l OS X...