 exit = (msg) ->
   log msg if msg
   process.exit()
+
+getWorkspacePath = (current, next) ->
+  [current, next] = [CWD, current] if not next
+  fs.exists path.join(current, 'dobi.json'), (exists) ->
+    if exists
+      next current
+    else
+      parent = path.join current, '..'
+      return next null if parent is current
+      getWorkspacePath parent, next
 
 log = (msg) ->
   console.log "[dobi] #{msg}"


  # initialize a workspace
  when 'init'
    exit 'not available yet'

  # create a site using your app
  when 'install'

fs = require 'fs'
open = require 'open'
optimist = require 'optimist'
path = require 'path'
readline = require 'readline'

# usage
