CodeKit2 icon indicating copy to clipboard operation
CodeKit2 copied to clipboard

Feature request: compile timestamp

Open macfire opened this issue 10 years ago • 9 comments

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"?

macfire avatar Apr 20 '15 23:04 macfire

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 [email protected] 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.

bdkjones avatar Apr 20 '15 23:04 bdkjones

@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/

subhaze avatar Apr 26 '15 14:04 subhaze

@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.

macfire avatar Apr 27 '15 19:04 macfire

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

subhaze avatar Apr 27 '15 20:04 subhaze

@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

macfire avatar Apr 27 '15 20:04 macfire

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 [email protected] 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.

bdkjones avatar Apr 27 '15 21:04 bdkjones

Yes, I'm now running build 18904.

macfire avatar Apr 27 '15 21:04 macfire

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

"${CK_OUTPUT_PATHS//:/}"

macfire avatar Apr 27 '15 21:04 macfire

@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...

subhaze avatar Apr 27 '15 21:04 subhaze