123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- var hconfig = require("hconfig");
-
- module.exports = parse;
-
- var configStructure = {
- display: {
- count: "many",
- props: {
- name: "string",
- mode: "string",
- rate: "string",
- where: "object",
- },
- },
- input: {
- count: "many",
- props: {
- name: "string",
- type: "string",
- commands: "array",
- options: "array",
- },
- },
- wallpaper: {
- count: "once",
- props: {
- name: "null",
- path: "string",
- },
- },
- process: {
- count: "many",
- props: {
- name: "string",
- run: "array",
- "in": [ "string", "null" ],
- env: [ "object", "null" ],
- restart: "bool",
- as: [ "string", "null" ],
- delay: [ "number", "null" ],
- },
- },
- }
-
- function parse(file) {
- try {
- return hconfig.parseConfFile(
- file, configStructure);
- } catch (err) {
- if (err.hconfigParseError) {
- console.error(err.message);
- process.exit(1);
- } else {
- throw err;
- }
- }
- }
|