From 37d470eb3fc14a7efb70e36417233e9ddcb6831e Mon Sep 17 00:00:00 2001 From: Aaron Powell Date: Mon, 22 Jul 2019 14:41:36 +1000 Subject: [PATCH] linting fix --- src/test/coverage.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/test/coverage.ts b/src/test/coverage.ts index a7a23e0..074f583 100755 --- a/src/test/coverage.ts +++ b/src/test/coverage.ts @@ -9,6 +9,13 @@ import * as path from 'path'; const REPO_ROOT = path.resolve(__dirname, '../..'); +function ensureDir(dirname: string): void { + if (fs.existsSync(dirname)) { + return; + } + ensureDir(path.dirname(dirname)); + fs.mkdirSync(dirname); +} function safeWriteFile(filePath: string, contents: Buffer | string): void { ensureDir(path.dirname(filePath)); @@ -19,14 +26,6 @@ function copyFile(inputPath: string, outputPath: string): void { safeWriteFile(outputPath, fs.readFileSync(inputPath)); } -function ensureDir(dirname: string): void { - if (fs.existsSync(dirname)) { - return; - } - ensureDir(path.dirname(dirname)); - fs.mkdirSync(dirname); -} - function _rreaddir(dirname: string, relativeTo: string, result: string[]): void { const entries = fs.readdirSync(dirname); for (let i = 0; i < entries.length; i++) {