   targetStream.destroy()
 
   # replace each key with each replacement using sed
-  args = ['-i']
+  args = ['-i', '']
   for key, rep of keys
-    args += ['-e', "s/#{key}/#{project[rep]}/g"]
-  args += [target]
+    args = args.concat ['-e', "s/#{key}/#{project[rep]}/g"]
+  args = args.concat [target]
+
+  console.log args
 
   proc = child_process.spawn 'sed', args, {'stdio' : ['ignore', 'ignore', 2]}
   await proc.on 'exit', defer code
 
 
 transform_dir = (dir, project, target) ->
+
+  console.log target
 
   # create the destination
   await fs.mkdir target, defer err


module.exports = (json_file) ->

  project = JSON.parse cat json_file

  throw "Couldn't parse project file #{json_file}" if not project?


  throw err if err?
  target = (path.join process.cwd(), project.project)

  console.log target
  transform_dir fullpath, project, target