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
4f6ccd6
commit 459d913
Showing
10 changed files
with
162 additions
and
50 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,37 @@ | ||
'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); | ||
|
||
var _path = require('path'); | ||
|
||
var _path2 = _interopRequireDefault(_path); | ||
|
||
// Example | ||
// | ||
// { | ||
// "forcePods": true | ||
// } | ||
|
||
function readConfig(__dir__, callback) { | ||
_fs2['default'].readFile(_path2['default'].join(__dir__, 'config.json'), 'utf8', function (err, data) { | ||
if (err) { | ||
callback({}); | ||
} else { | ||
var options = Object.assign({ | ||
"forcePods": false | ||
}, 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 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,35 @@ | ||
'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(callback) { | ||
_fs2['default'].readFile('./.bluprintconfig', 'utf8', function (err, data) { | ||
if (err) throw err; // we'll not consider error handling for now | ||
|
||
var options = Object.assign({ | ||
"rootDirectory": "app", | ||
"blueprintsDirectory": "blueprints" | ||
}, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"enablePods": "true", | ||
"enablePods": "true" | ||
} |
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,3 @@ | ||
{ | ||
"forcePods": true | ||
} |
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'; | ||
import path from 'path'; | ||
|
||
// Example | ||
// | ||
// { | ||
// "forcePods": true | ||
// } | ||
|
||
export default function readConfig(__dir__, callback) { | ||
fs.readFile(path.join(__dir__, 'config.json'), 'utf8', function (err, data) { | ||
if (err) { | ||
callback({}); | ||
} else { | ||
const options = Object.assign( | ||
{ | ||
"forcePods": false | ||
}, | ||
JSON.parse(data) | ||
); | ||
callback(options); | ||
} | ||
}); | ||
} |
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
File renamed without changes.