   summary: "Builds a given project to an output path."
 
   doc: """
-  fork2 build-project $PROJECT_PATH $OUTPUT_PATH
+  fork2 build-project $PROJECT_PATH [$OUTPUT_PATH]
+
+  $OUTPUT_PATH defaults to $PROJECT_PATH/.workspace
   """
 
   # TODO. rebuild option should remove the otuput path before build.

    inPath = args._[0]
    outPath = args._[1]

    if !inPath || !outPath
      @help()
      return

    # TODO check if input path is valid
    inPath = @ensureTrailingSlash(inPath)

    inPath = @ensureTrailingSlash(inPath)
    # with the trailing slash in inPath, rsync copies the content of inPath to
    # outPath without creating a subdirectory in outPath.
    code = @sh("rsync --exclude '.workspace' -Pa #{inPath} #{outPath}")


module.exports = new BuildProject()