Skip to content

Commit

Permalink
add: support for jsonc
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenlacy committed Apr 4, 2024
1 parent 7101171 commit 578ce75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/lib/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { deepmerge, dotenv, path, ulid, ValidationError } from '/deps.ts'
import { parse } from "https://deno.land/[email protected]/jsonc/parse.ts";
import { CliOptions, RunrealConfig } from '/lib/types.ts'
import { execSync } from '/lib/utils.ts'
import { z } from 'https://deno.land/x/zod/mod.ts'
Expand Down Expand Up @@ -123,7 +124,7 @@ class Config {
private async readConfigFile(configPath: string): Promise<Partial<RunrealConfig> | null> {
try {
const data = await Deno.readTextFile(path.resolve(configPath))
return JSON.parse(data) as RunrealConfig
return parse(data) as RunrealConfig
} catch (e) { /* pass */ }
return null
}
Expand Down

0 comments on commit 578ce75

Please sign in to comment.