         do complete
 
 # Build the .deb installer
-build_debian_installer = actions['deb'] = actions['debian'] = ( complete ) ->
+build_debian_installer = actions['debian_installer'] = ( complete ) ->
     complete ?= (-> null)
     release_dir = path.join(scriptdir, 'releases', 'pman-linux-x64')
     installers_dir = path.join(scriptdir, 'installers')
     
+    console.log "creating debian installer for pman"
     options =
         src  : release_dir
         dest : installers_dir


packager = require 'electron-packager'
deb_installer = require 'electron-installer-debian'

scriptdir = (__dirname + '')


            console.error( error )
        else
            console.log " -- Created Debian Installer for PMan -- "
        do complete

    deb_installer(options, dicb)

# Build the Windows installer
build_windows_installer = actions['windows_installer'] = ( complete ) ->
    complete ?= (-> null)
    release_dir = (arch) -> path.join(scriptdir, 'releases', "pman-windows-#{arch}")
    installers_dir = path.join(scriptdir, 'installers')
    builds = []
    itask = (o) -> (callback) -> win_installer(o, callback)
    plan = (o) -> builds.push itask o
    opts = (arch) ->
        src  : release_dir arch
        dest : installers_dir
        arch : arch

    plan opts 'ia32'
    plan opts 'x64'

    callback = (error) ->
        if error?
            console.error error
        else
            console.log " -- Created Windows Installers for PMan -- "
            do complete

    async.series(builds, callback)

# 'main' function
do ->
    # get parameters
    actionNames = process.argv[2..]
    if not actionNames.length
        actionNames.push 'all'
    actionNames = actionNames.map (s) -> s.toLowerCase()
    do ->
        if actionNames[0] == 'installers'
            actionNames = ['debian_installer', 'windows_installer']
    tasks = do ->
        if actionNames.length == 1
            switch actionNames[0]
                when 'all'
                    for name of actions then actions[name]
                else
                    [actions[actionNames[0]]]
        else
            for name in actionNames
                if name of actions
                    actions[name]
    taskCallback = (error) ->
        if error?
            console.error error
