3 Aug 2010

Making your software life a lot easier.

For many projects, you create your own development folder structure.  One key task is making sure you have what I call the deploy folder.

In this folder is only the files and folder that will be copied to the server or to a client.

Pastedgraphic-2

One of my favourite tools is DropBox.com , DropBox simply creates a set of folders on you computer which are automagically synced to the cloud.  You can also create a new folder within this set and share that folder with your clients or friends.  Files in these shared folders are also synced near instantly.  Its really quite "magical", I think of DropBox as the poor mans file server.  

To my point.  I like to automate the deployment of my file deploy folder to a dropbox shared folder.  I do that with 1 click and this file.

Pastedgraphic-3
So this file is located in the sub directory "compile" 
Look at the first line it says.
#! /bin/zsh 

This means don't use the old mac Bash Shell but use something called zShell. It has a few extra commands that will come in handy.
What is cool about zShell is that you can find where the command file was executed from. Which means you can sync files relative to your project directory. 

Now I use "rsync" to copy on the changed files, "-v" means shows me anything that is copied. "-a" is archive mode which only copies missing files or changed files. and --exclude allows me to exclude any types of files or folders that I want ignored (yes I have some PSD files in my deploy).

If you write this code in TextMate and save the file as mirror_files.commmand.
Then since OSX does not allow you execute this file by double clicking it.
In TextMate goto Bundles > Shell Script > Make Script Executable.
Or using terminal the below command will make it executable
chmod u+x mirror_files.command

Pastedgraphic-4

Now you can just double click this file to run it.

When you run the file you should see something like this.
Pastedgraphic-5
This really does make life a lot easier for me and my clients.