Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Steven Ventimiglia
Steven Ventimiglia
27,371 Points

How can you hook a script that will run after simply saving a file?

So, I wrote a fast script that you run with ". .script [name]". It's stupid simple, but I love it. Took me like an hour or so and a good dose of Stack Overflow. :P

I use Codekit on an iMac at work. I set it up as a hook, not understanding the coolness of those. So, I came home and tried it with Prepros. My conclusion: "Not sure. Don't think so."

How do I get Windows, OS X and Ubuntu/CentOS to watch a file in a specified project directory, and run the script I tell it to when I save it?

1 Answer

what you are looking for is a thing called shell scripting, I wish they had a course here. I'm still in the process of writing these, but I would suggest you youtube shell scripting automation, and take a look at this article, scroll to the automation:

shell script

I hope this helps.

here is a tutorial on bash scripts:

bash