MCPcopy Index your code
hub / github.com/deployd/deployd / loadResourceDir

Function loadResourceDir

lib/config-loader.js:51–65  ·  view source on GitHub ↗
(basepath, fn)

Source from the content-addressed store, hash-verified

49}
50
51function loadResourceDir(basepath, fn) {
52 var resourceDir = path.join(basepath, 'resources');
53 try {
54 // get all folders that have a config.json
55 var folders = shell.ls('-R', resourceDir + path.sep + '**' + path.sep + 'config.json').map(function(file) {
56 // get just the relative part of the folder, stripping resource dir
57 return path.relative(resourceDir, path.dirname(file)).split(path.sep).join('/'); // make sure separators are slashes
58 });
59
60 fn(null, folders);
61 } catch (err) {
62 console.log(err);
63 fn(err);
64 }
65}
66
67function loadResources(getTypes, basepath, server, files, fn) {
68 async.map(files, function (resourceName, fn) {

Callers

nothing calls this directly

Calls 1

fnFunction · 0.85

Tested by

no test coverage detected