Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Objectivist-C

macrumors 6502
Original poster
Jul 1, 2006
443
27
I wrote a script to keep some of the open-source software I use up-to-date. For those using subversion repositories, is there a way to branch the script depending on whether or not a new revision was detected, and similarly, to branch it depending on whether or not the Xcode build succeeds? Script follows below (feel free to point out any newbie mistakes):

Code:
#! /bin/bash

cd /Volumes/External/src/gears
svn update
cd /Volumes/External/src/gears/base/safari/project/
xcodebuild

cd /Volumes/External/src/adium
svn update
xcodebuild
cp -RLf build/Development/Adium.app /Applications

cd /Volumes/External/src/Transmission
svn update
xcodebuild
cp -RLf macosx/Transmission.app /Applications

cd Desktop/Inbox/
wget -r http://ftp.mozilla.org//pub/mozilla.org/camino/nightly/latest-1.6-M1.8/Camino.dmg
open Camino.dmg
cp -RLf /Volumes/Camino/Camino.app /Applications/Browsers
hdiutil detach /Volumes/Camino/
mv Desktop/Inbox/Camino.dmg ~/.Trash/

exit
 

Objectivist-C

macrumors 6502
Original poster
Jul 1, 2006
443
27
Also, on the same subject, how would one go about closing an application from a script without knowing the PID beforehand?

EDIT: OK, I guess Applescript would do the trick, but out of curiosity, is there a bash-ier way of doing it?
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Also, on the same subject, how would one go about closing an application from a script without knowing the PID beforehand?

EDIT: OK, I guess Applescript would do the trick, but out of curiosity, is there a bash-ier way of doing it?

Code:
killall MyApp

But that is like a force quit. You can probably make it safer by using the -SIGNAL option.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.