global: Add the root_path variable in global.

This will can be help for work the better way in use the path into
the core and modules.
This commit is contained in:
Rodrigo Ramírez Norambuena 2016-12-27 14:31:35 -03:00
parent 4237d0c7e3
commit f58e758a41
2 changed files with 4 additions and 0 deletions

View File

@ -34,6 +34,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Added abilty set the classes option to compliments module for style and text size of compliments. - Added abilty set the classes option to compliments module for style and text size of compliments.
- Added ability to configure electronOptions - Added ability to configure electronOptions
- Calendar module: option to hide private events - Calendar module: option to hide private events
- Add root_path for global vars
### Updated ### Updated
- Modified translations for Frysk. - Modified translations for Frysk.

View File

@ -14,6 +14,9 @@ var path = require("path");
global.version = JSON.parse(fs.readFileSync("package.json", "utf8")).version; global.version = JSON.parse(fs.readFileSync("package.json", "utf8")).version;
console.log("Starting MagicMirror: v" + global.version); console.log("Starting MagicMirror: v" + global.version);
// global absolute root path
global.root_path = path.resolve(__dirname + "/../");
// The next part is here to prevent a major exception when there // The next part is here to prevent a major exception when there
// is no internet connection. This could probable be solved better. // is no internet connection. This could probable be solved better.
process.on("uncaughtException", function (err) { process.on("uncaughtException", function (err) {