Skip to content

Commit

Permalink
fix: ensure json path exists
Browse files Browse the repository at this point in the history
  • Loading branch information
plantain-00 committed Apr 29, 2018
1 parent e8aa77d commit 902dd1c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@commitlint/cli": "6.1.3",
"@commitlint/config-conventional": "6.1.3",
"@types/chokidar": "1.7.5",
"@types/fs-extra": "5.0.2",
"@types/jasmine": "2.8.6",
"@types/minimist": "1.2.0",
"@types/node": "10.0.0",
Expand Down Expand Up @@ -58,6 +59,7 @@
"dependencies": {
"ajv": "6.4.0",
"chokidar": "2.0.3",
"fs-extra": "5.0.0",
"minimist": "1.2.0",
"protobufjs": "6.8.6",
"typescript": "2.8.3"
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import ts from 'typescript'
import * as fs from 'fs'
import * as path from 'path'
import * as chokidar from 'chokidar'
import fse from 'fs-extra'
import { Generator } from './core'
import * as packageJson from '../package.json'

Expand Down Expand Up @@ -98,6 +99,7 @@ async function executeCommandLine () {
}

if (jsonPath) {
fse.ensureDirSync(jsonPath)
const schemas = generator.generateJsonSchemas()
for (const { entry, schema } of schemas) {
if (debugPath || ajv.validateSchema(schema)) {
Expand Down
8 changes: 7 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,12 @@
version "1.2.0"
resolved "https://registry.yarnpkg.com/@types/events/-/events-1.2.0.tgz#81a6731ce4df43619e5c8c945383b3e62a89ea86"

"@types/[email protected]":
version "5.0.2"
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-5.0.2.tgz#235a7e2b56452cc0a6a4809b53e1d1eaffff9c96"
dependencies:
"@types/node" "*"

"@types/[email protected]":
version "2.8.6"
resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.6.tgz#14445b6a1613cf4e05dd61c3c3256d0e95c0421e"
Expand Down Expand Up @@ -2854,7 +2860,7 @@ from2@^2.1.0, from2@^2.1.1:
inherits "^2.0.1"
readable-stream "^2.0.0"

fs-extra@^5.0.0:
fs-extra@5.0.0, fs-extra@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-5.0.0.tgz#414d0110cdd06705734d055652c5411260c31abd"
dependencies:
Expand Down

0 comments on commit 902dd1c

Please sign in to comment.