Skip to content

Instantly share code, notes, and snippets.

@clindsey
Forked from lainebrain/SVNMagic.scpt
Created January 29, 2010 19:15
Show Gist options
  • Select an option

  • Save clindsey/289997 to your computer and use it in GitHub Desktop.

Select an option

Save clindsey/289997 to your computer and use it in GitHub Desktop.
try
set visible of window "SVNwindow" to true
tell application "Finder"
activate
set theWin to window 1
set thePath to (POSIX path of (target of theWin as alias))
try
set svnAdd to do shell script "cd " & thePath & ";svn add * --force;"
set svnUp to do shell script "cd " & thePath & ";svn update;"
set svnStatus to do shell script "cd " & thePath & ";svn status | awk '{print $1, $2}'"
set visible of window "SVNwindow" to false
if (svnStatus) then
display dialog thePath & "
" & svnAdd & "
" & svnUp & "
" & svnStatus & "
Enter message:" default answer msg buttons {"Cancel", "Commit"} default button 2
if the button returned of the result is "Commit" then
try
set svnCommit to do shell script "cd " & thePath & ";svn commit -m \"" & msg & "\";"
display dialog svnCommit
on error svnerror
display dialog svnerror
end try
end if
else
display dialog thePath & "
" & svnAdd & "
" & svnUp
end if
on error the_error
display dialog the_error
end try
end tell
end try
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment