A shell script can be easily wrapped into OS X bundle so that you can simply double click on an icon and this will effectively run the script. All you have to do is create the following directory structure:
MyBundle.app/
MyBundle.app/Contents/
MyBundle.app/Contents/MacOS/
MyBundle.app/Contents/MacOS/MyBundle
Notice MyBundle in MacOS directory has to be the same as MyBundle.app minus the .app (this is a very simply and limited method). You can now double click on MyBundle.app to run MyBundle script.
If you want to be a little more fancy you can even assign an icon to this bundle. Create MyBundle.app/Contents/Resources directory and drop .icns file in there. Create a file MyBundle.app/Contents/Info.plist and in it you can specify the icon file name. Below is an example of a .plist that will launch MyBundle application (CFBundleExecutable) and uses MyIcons.icns in Resources (CFBundleIconFile). Note that .icns extension isn’t there.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC “-//Apple Computer//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”>
<plist version=”1.0″>
<dict>
<key>CFBundleExecutable</key>
<string>MyBundle</string>
<key>CFBundleIconFile</key>
<string>MyIcons</string>
</dict>
</plist>
Now, after you’ve done all that, there is even an easier way … Open your terminal, go to File -> Save As. Here you can specify “Execute this command” or basically the path to your script.
P.S. You can always bundle your .jar apps with Jar Bundler included with XCode Tools.
Subversion on OS X Quickly
Go to subversion.tigris.com. In “Downloads” section you may want to follow Fink way of doing things, however, I chose the latest binary build from Metissan. The installer will dump the binaries into /usr/local/bin. Become root and edit PATH in /etc/profile to include the svn install path. Create your repository (i.e. svnadmin create /SvnRepo). In your newly created repository edit conf/passwd to include usernames and passwords of your preference:
[users] user=password
Edit your svnserve.conf to look like:
[general] anon-access = none auth-access = write password-db = passwd
Now you’ll likely want svnserve to host your repo via default port 3690; to do this simply execute: svnserve -d --root /SvnRepo In order to run svnserve automatically on startup, you’ll have to jump one more hoop. Become root and create the following directory : /Library/StartupItems/svn Here, create StartupParameters.plist and svn files. Give svn file 750 permissions. Edit StartupParameters.plist to look like:
And here is a lazy example of what svn might look like:
Ok, now you can restart. When you’re back up you’ll want a decent client. Don’t fall prey to SCPlugin. At the time of writing this post, SCPlugin is but an awkward attempt at mimicking Tortoise. OS X still lacks SVN client variety but things like svnX and Subclipse should suffice.
[users] user=password
Edit your svnserve.conf to look like:
[general] anon-access = none auth-access = write password-db = passwd
Now you’ll likely want svnserve to host your repo via default port 3690; to do this simply execute: svnserve -d --root /SvnRepo In order to run svnserve automatically on startup, you’ll have to jump one more hoop. Become root and create the following directory : /Library/StartupItems/svn Here, create StartupParameters.plist and svn files. Give svn file 750 permissions. Edit StartupParameters.plist to look like:
{
Description = "Subversion";
Provides = ("Subversion Server");
Requires = ("Resolver");
Preference = "Late";
Message =
{
start = "Starting Subversion";
stop = "Stopping Subversion";
};
}
And here is a lazy example of what svn might look like:
#!/bin/sh
##
# Svnserve
##
. /etc/rc.common
StartService ()
{
ConsoleMessage "Starting Svnserve"
/usr/local/bin/svnserve -d --root /Users/artem/Repo
}
StopService ()
{
ConsoleMessage "Stopping Svnserve"
}
RestartService ()
{
ConsoleMessage "Restarting Svnserve"
}
RunService "$1"
Ok, now you can restart. When you’re back up you’ll want a decent client. Don’t fall prey to SCPlugin. At the time of writing this post, SCPlugin is but an awkward attempt at mimicking Tortoise. OS X still lacks SVN client variety but things like svnX and Subclipse should suffice.
Subscribe to:
Posts (Atom)
