Skip to content

Commit

Permalink
fix(api): write JSON files async with indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuri committed Aug 3, 2018
1 parent 997cd26 commit 872d82f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/api/setup.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { join, resolve } from 'path';
import { existsSync, copyFile, ensureDirectory } from './fs';
import { readFileSync, writeFileSync } from 'fs';
import { ensureDirSync, statSync, remove, readJSON, writeJSON } from 'fs-extra';
import { ensureDirSync, statSync, remove, readJson, writeJson } from 'fs-extra';
import * as uuid from 'uuid';
import * as temp from 'temp';
import * as glob from 'glob';
Expand Down Expand Up @@ -104,7 +104,7 @@ export function getConfig(): string {

export function getConfigAsync(): Promise<any> {
const configPath = getFilePath('config.json');
return readJSON(configPath);
return readJson(configPath);
}

export function saveConfig(cfg: any): void {
Expand All @@ -114,7 +114,7 @@ export function saveConfig(cfg: any): void {

export function saveConfigAsync(cfg: any): Promise<void> {
const configPath = getFilePath('config.json');
return writeJSON(configPath, cfg);
return writeJson(configPath, cfg, { spaces: 2 });
}

export function getCacheFilesFromPattern(pattern: string): any[] {
Expand Down

0 comments on commit 872d82f

Please sign in to comment.