Hi.
I have a script which echos stuff into an html file and then renders markdown there. It works when called from the terminal. When called in a Alfred workflow however, the echo commands work – the redcarpet command doesn't.
I suspect it might have to do with me using rbenv and the enviroment not being accessible in the workflow, but am not fluent enough to debug this.
Here is the workflow:
#!/bin/bash
f=~/projects/filtercake/linklist.md
t=`mktemp /tmp/alfred_prepend.XXXXXXXX`
q={query}
d=`date +%Y-%m-%d`
e="- "$q" ["$d"]"
cat - $f <<< $e > $t
mv $t $f
rm $t
~/projects/filtercake/render-linklist
And here is the script:
#!/bin/bash
cd ~/projects/filtercake
touch bookmarks.html
echo "---" > bookmarks.html
echo "layout: default" >> bookmarks.html
echo "title: bookmarks" >> bookmarks.html
echo "---" >> bookmarks.html
echo " " >> bookmarks.html
echo "<h1>Bookmarks</h1>" >> bookmarks.html
redcarpet linklist.md >> bookmarks.html
The workflow is here: https://dl.dropboxusercontent.com/u/2146484/bookmark.alfredworkflow
Any help would be much appreciated...