I have been using Alfred v2 for a couple of weeks now and I am very pleased about the workflow feature from the Power pack.

I try to develop some workflows myself and now I have developed an easy workflow for Octopress , the static site generator.

Octopress is coming with some rake commands to maintain the site.

I have implemented some of these rake commands in an Alfred workflow.

- keyword generate -> rake generate
- keyword deploy -> rake gen_deploy

This was a bigger challenge than I expected because of the way I installed the required Ruby version. (rvm)

In my bash script I had to add some extras because Alfred runs the bash script in a subshell and in this subshell the rvm environment is not available by default.

cd $HOME/Sites/dailyscrum
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

# without the below settings you get an error
# plugins/backtick_code_block.rb:13:in `gsub': invalid byte sequence in US-ASCII (ArgumentError)

export LANG=en_US.utf-8

bundle install
rake generate 2>&1 | tee $HOME/Sites/dailyscrum/error.log