mirror of
https://github.com/zhigang1992/firebase-tools.git
synced 2026-01-13 09:09:56 +08:00
16 lines
374 B
JavaScript
16 lines
374 B
JavaScript
"use strict";
|
|
|
|
var FirebaseError = require("./error");
|
|
var cjson = require("cjson");
|
|
|
|
module.exports = function(path) {
|
|
try {
|
|
return cjson.load(path);
|
|
} catch (e) {
|
|
if (e.code === "ENOENT") {
|
|
throw new FirebaseError("File " + path + " does not exist", { exit: 1 });
|
|
}
|
|
throw new FirebaseError("Parse Error in " + path + ":\n\n" + e.message);
|
|
}
|
|
};
|