forked from slightlytyler/bluprint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
459d913
commit 6e14b39
Showing
11 changed files
with
101 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = { | ||
"rootDirectory": "app", | ||
"blueprintsDirectory": "blueprints" | ||
}; | ||
module.exports = exports["default"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = { | ||
"rootDirectory": "app", | ||
"blueprintsDirectory": "blueprints" | ||
}; | ||
module.exports = exports["default"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
exports['default'] = readConfig; | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
|
||
var _fs = require('fs'); | ||
|
||
var _fs2 = _interopRequireDefault(_fs); | ||
|
||
// Example | ||
// | ||
// { | ||
// "rootDirectory": "dummy/app", | ||
// "podsDirectory": "pods", | ||
// "blueprintsDirectory": "dummy/pods" | ||
// } | ||
|
||
function readConfig(__dir__, callback) { | ||
var defaults = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; | ||
|
||
_fs2['default'].readFile(__dir__, 'utf8', function (err, data) { | ||
if (err) { | ||
callback(defaults); | ||
} else { | ||
var options = Object.assign(defaults, JSON.parse(data)); | ||
|
||
callback(options); | ||
} | ||
}); | ||
} | ||
|
||
module.exports = exports['default']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default { | ||
"rootDirectory": "app", | ||
"blueprintsDirectory": "blueprints" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import fs from 'fs'; | ||
|
||
// Example | ||
// | ||
// { | ||
// "rootDirectory": "dummy/app", | ||
// "podsDirectory": "pods", | ||
// "blueprintsDirectory": "dummy/pods" | ||
// } | ||
|
||
export default function readConfig(__dir__, callback, defaults = {}) { | ||
fs.readFile(__dir__, 'utf8', function (err, data) { | ||
if (err) { | ||
callback(defaults) | ||
} else { | ||
const options = Object.assign( | ||
defaults, | ||
JSON.parse(data) | ||
); | ||
|
||
callback(options); | ||
} | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.