Appdmg Functions - mvaltas/grind GitHub Wiki

The appdmg API is a set of shortcuts for installing applications packaged in a dmg file.

Usage

At your definition file start by requiring appdmg like so:

use "appdmg"

Functions

appdmg APPNAME DMG_URI

use "appdmg"

appdmg "SomeApplication" "http://somehost.com/download/someApplication.dmg"

Where APPNAME is the name of the application without the .app extension. This is the name the API will use to write the application into /Applications. DMG_URI is the address from where the dmg file will be downloaded.

Details

This shortcut does a lot, it uses curl to download the file into a temporary directory, mounts the image and scans for .app directories. If found, the .app directories are copied into /Applications.

The APPNAME is used as a marker to run or not the installation, given an APPNAME an unless_dir "/Applications/APPNAME.app" will be called.

appdmg_custom DMG_URI

This function will wait for a check (like an unless call) before attempting to install the application. It is design for more complex checks like composing checks. A simple example, which is the same as the appdmg function would be:

appdmg_custom "DMG_URI"
 unless_dir "/Applications/Application.app"