What to do

if you wan't to use a version control and deliver to co-workers always a up to date version of your scripts?



I found a solution. Git. See the webpage git-scm.com.
But how to deliver the controlled scripts? On Windows you can use the msysgit and tortoisegit. After you have once downloaded the git on the machine evrybody will be able to make a right mouse click and say "sync/pull".
But what to do on a mac?
Well - I wrote something.
U can use AppleScript with the terminal.
Download and install Git on the Mac. And than use these two AppleScripts.
They work best if you close the Terminal.app before launching. Download them here
--First script "cloneGit_at_appLocation.app" start:
-- Get the path of the script
set StoredPath to (path to me) as string
-- get the parent folder of the script
tell application "Finder"
set theFolder to (container of item StoredPath) as text
end tell

-- get the ":" from the path and replace them with "/" so terminal will understand
set EditedPath to quoted form of POSIX path of theFolder
-- open terminal
tell application "Terminal"
activate
--wait a moment
delay 3
-- change to the folder where the script is
-- if you run this from the Skripteditor it will use the path of the editor
-- save the script as .app then it will use the apps path
do script "cd " & EditedPath in front window
-- now clone the git hello-world
do script "git clone git://github.com/git/hello-world.git" in front window
end tell
-- you are done
--First script "cloneGit_at_appLocation.app" end.



--second script "pullGit_at_appLocation.app" start:


*****
The second script has to be inside the new folder the first script created
*****
-- this is mostly the same as the "cloneGit_at_appLocation.app" script

-- get the path
set StoredPath to (path to me) as string

--get parent
tell application "Finder"
set theFolder to (container of item StoredPath) as text
end tell

-- replace ":" with "/"
set EditedPath to quoted form of POSIX path of theFolder
-- open terminal
tell application "Terminal"
activate

-- wait
delay 3
-- go to folder
do script "cd " & EditedPath in front window
-- update the git in this folder
do script "git pull origin master" in front window
end tell