Created
January 27, 2013 22:26
-
-
Save wolfeidau/4650974 to your computer and use it in GitHub Desktop.
Error handling..
This file contains hidden or 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
| var fs = require('fs') | |
| , path = require('path') | |
| , errors = require('./errors') | |
| exports.load = function(handleResult, configPath){ | |
| var path = configPath || "./.swagman.json" // note the optional configuration path | |
| fs.readFile(path, function (err, data) { | |
| handleResult(err, data) | |
| }) | |
| } | |
| exports.loadConfig = function(configPath, callback){ | |
| configPath = configPath || './.swagman.json' | |
| return require(path.resolve(configPath)) | |
| } | |
| exports.loadAwsConfiguration = function (configPath, callback) { | |
| configPath = configPath || path.join(process.env.HOME, '.swagman_ec2.json') | |
| return require(path.resolve(configPath)) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment