Commit f5f885da authored by Jörn Reder's avatar Jörn Reder
Browse files

[config] fix: crash when installed as project dependency

parent 7d83dad1
......@@ -5,3 +5,4 @@
/coverage
/.cache
/tmp
/src/schema-config.json
......@@ -5,6 +5,7 @@ cache:
- build
- node_modules
- .cache
- src/schema-config.json
stages:
- build
......
......@@ -15,7 +15,7 @@
"automation"
],
"scripts": {
"build": "tsc -p . && typescript-json-schema --noExtraProps tsconfig.json ConfigData > build/schema-config.json && chmod 755 build/schedic.js",
"build": "typescript-json-schema --noExtraProps tsconfig.json ConfigData > src/schema-config.json && tsc -p . && chmod 755 build/schedic.js && cp src/schema-config.json build/schema-config.json",
"lint": "tslint -c tslint.json 'src/**/*.ts'",
"test": "mocha",
"cover": "nyc --reporter=text --reporter=html --reporter=lcov mocha",
......@@ -27,7 +27,6 @@
},
"dependencies": {
"ajv": "^6.10.0",
"app-root-path": "^2.1.0",
"chalk": "^2.4.2",
"js-yaml": "^3.12.2",
"lodash": "^4.17.11",
......
import * as Ajv from "ajv";
import * as appRootPath from "app-root-path";
import * as fs from "fs";
import * as yaml from "js-yaml";
import * as _ from "lodash";
......@@ -196,7 +195,7 @@ function verify() {
// Do JSON Schema validation
const ajv = new Ajv({ allErrors : true });
const schema = require(appRootPath + "/build/schema-config.json");
const schema = require("../schema-config.json");
const valid = ajv.validate(schema, configData);
if ( !valid ) {
......
......@@ -167,11 +167,6 @@ anymatch@^2.0.0:
micromatch "^3.1.4"
normalize-path "^2.1.1"
app-root-path@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-2.1.0.tgz#98bf6599327ecea199309866e8140368fd2e646a"
integrity sha1-mL9lmTJ+zqGZMJhm6BQDaP0uZGo=
append-transform@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-1.0.0.tgz#046a52ae582a228bd72f58acfbe2967c678759ab"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment