TextMate Bundle For Committing KRL

TextMate KRL Commit Bundle

TextMate KRL Commit Bundle

I created a simple TextMate bundle that maps cmd + k to saving the app code and then committing the app to the Kynetx servers.

You can view and download the bundle on my github at http://gist.github.com/437379

Growl Notifications for Kynetx KRL Command Line Tool

KRL Commit Growl Notification

KRL Commit Growl Notification

I have been using the Kynetx KRL command line tool for several weeks now and it has made my development of Kynetx apps much easier. The only problem that I have had as I have been using the command line tool is that once I commit my app I have to wait a few seconds before being able to run the new version in my browser. Until now I have been doing a lot of command + tab switching between windows to check to see if it has finished saving.

I have now created a clean solution that allows me to know when the version has finished being committed to the Kynetx servers and had one unexpected benefit.

I started out by creating a simple bash alias that would pipe the output from the ‘krl commit’ command to a growl notification

# Growl notify after krl commit is done
alias krlc="krl commit | growlnotify -t "KRL" --image /Users/mikegrace/src/kynetx-x.png;"

I quickly realized that this wouldn’t work for me because piping the console to the growl notification means that the commit output wouldn’t be visible on the console.  I need to be able to see on the console what the output was in case there were errors or the latest saved version so I started looking for a better solution and came up with this

# Use growlnotify to alert user of commit status
krl() {
 if [[ $@ == "commit" ]]; then
  command krl commit | tee status.txt | growlnotify -t "KRL" --image /kynetx-x.png;
  cat status.txt;
 else
  command krl $@
 fi;
}

I created a function in my bash profile that runs when I run the krl command. When it sees me using the commit parameter it will do a krl commit and then tee that output to a status.txt file and pipe it to the growl notification. To have the output also show up on the console I cat the status.txt file back to the console. The unforeseen benefit here is that it is now really easy to share error output with others because it can be found in the status.txt file in the app folder.

I also created a bash script, available on my github, that takes care of the installation for you. I created this script purely for fun and I had a blast doing it!

I had a really great time doing all of this and learned a lot. There is a lot of power in being able to manipulate command line tools to make tasks easier.

As Bigweld would say, “See a need, fill a need”

01 Setting up your Kynetx App

So you want to take over the world with your great Kynetx app idea. Awesome! This video will help you get started on the right foot and avoid some common mistakes that people make when creating a Kynetx app.

If you would like to watch more of these Kynetx Tuts, you can view them at http://geek.michaelgrace.org/tag/kynetx-tuts/

Kynetx Friday Lunches – Free & Every Friday!

We share every friday from 11:30 – 1:30, here at Kynetx, our excitement about the Kynetx platform and free food!

If you…

  • want to learn about what it is that Kynetx does
  • wonder why we say, “This changes everything”
  • want free food
  • want to geek out with cool people
  • learn how to program the web
  • are looking for an internship or part time job
  • want to be cool

… then we highly encourage you to come join us!

We are located at 343 East 4th North #103 Rexburg, ID 83440

Google map -> http://goo.gl/dE7Y

Google street view -> http://goo.gl/Ixao

The party will be from 11:30 – 1:30 and we hope you will come. Let us know via TwitterEmail, or Buzz.