pheuter / discourse-notify

Native app that displays Discourse notifications on the desktop
1 stars 0 forks source link

Consider using Platypus #3

Open paulyoung opened 11 years ago

paulyoung commented 11 years ago

I've used it before as a wrapper for shell scripts to give the appearance of a native Mac app.

In this case maybe the shell script could just run ruby app.rb (all resources can be bundled with it).

paulyoung commented 11 years ago

http://sveinbjorn.org/platypus

paulyoung commented 11 years ago

Looks like it directly supports Ruby.

pheuter commented 11 years ago

This looks pretty cool, going to give it a try.

pheuter commented 11 years ago

I seem to be running into some hiccups where the script doesn't recognize the user environment when executed from Platypus.

paulyoung commented 11 years ago

Here's how I did it before:

#!/bin/sh

# The following files are bundled:
#
# 'bless.js'
# 'growlnotify'
# 'node'
#
#

APP_NAME="Bless"

RESOURCES="${1}/Contents/Resources/"

export PATH=$RESOURCES:$PATH

BLESSC="bless.js/bin/blessc"
GROWLNOTIFY="growlnotify"

FILENAME=$(basename ${2})
MESSAGE="$($BLESSC ${2} -f)"
MESSAGE=${MESSAGE//blessc: /}

$GROWLNOTIFY -n $APP_NAME -a $APP_NAME -t ${FILENAME} -m "${MESSAGE}"
paulyoung commented 11 years ago

That is where Bless.app/Contents/Resources contained binaries for growlnotify, node and a bless.jd directory among other things generated by Platypus.

pheuter commented 11 years ago

'node'

You bundled node?