Permalink
Browse files

Fixing teleport reflect command.

  • Loading branch information...
1 parent 2977e49 commit d629ed443fb910b65342c85a3259829ab5dba17b @Gozala committed Feb 24, 2011
Showing with 13 additions and 1 deletion.
  1. +13 −1 commands/reflect.js
View
@@ -28,7 +28,8 @@ var reflectPackage = Promised(function reflectPackage(path, name, catalog, $$) {
var pack = catalog[name]
var modules = pack.get('modules')
var dependencies = pack.get('dependencies')
- var modulesReady = writeModules(destinationPath, modules, pack)
+ var files = pack.get('files')
+ var modulesReady = writeModules(path, modules, pack)
var dependenciesReady = reflectPackages(path, dependencies, $$)
return all([modulesReady, dependenciesReady])
})
@@ -55,3 +56,14 @@ var writeModules = Promised(function writeModules(path, modules, catalog) {
})
}))
})
+
+var writeFiles = Promised(function writeFiles(destinationPath, files) {
+ return all(files.forEach(files).map(function (path) {
+ path = fs.join(destinationPath, path)
+ var destinationDirectory = fs.directory(path)
+ var content = fs.read(path)
+ return Q.when(fs.makeTree(destinationDirectory), function() {
+ return fs.write(path, content)
+ })
+ }))
+})

0 comments on commit d629ed4

Please sign in to comment.