diff --git a/src/lib/create.ts b/src/lib/create.ts index d57b9f4..9d00292 100644 --- a/src/lib/create.ts +++ b/src/lib/create.ts @@ -28,6 +28,6 @@ export function create (name: string) { mkdirp.sync(savePath) createDecisions(name, savePath) - let toc = generate('toc', {output: false}) + let toc = generate('toc', { output: false }) fs.writeFileSync(savePath + 'README.md', toc) } diff --git a/src/lib/logs.ts b/src/lib/logs.ts index bf122cb..a6afa59 100644 --- a/src/lib/logs.ts +++ b/src/lib/logs.ts @@ -9,8 +9,8 @@ let path = Config.getSavePath() let getAllFilesName = function (): string[] { let outputArray = [''] - let files = walkSync.entries(path, { globs: ['**/*.md']}) - files.forEach( function (file) { + let files = walkSync.entries(path, { globs: ['**/*.md'] }) + files.forEach(function (file) { let fileName = file.relativePath let index = Utils.getIndexByString(fileName) diff --git a/src/lib/search.ts b/src/lib/search.ts index ba7dc9f..f8c827d 100644 --- a/src/lib/search.ts +++ b/src/lib/search.ts @@ -15,7 +15,7 @@ function buildTocBodyFun (index, decision, file, bodyString): string[] { } export function search (keywords) { - findInFiles.find({'term': keywords, 'flags': 'ig'}, savePath, '.md$') + findInFiles.find({ 'term': keywords, 'flags': 'ig' }, savePath, '.md$') .then(results => { let files: object[] = [] for (let result in results) { diff --git a/src/lib/status.ts b/src/lib/status.ts index 0d442d6..5464532 100644 --- a/src/lib/status.ts +++ b/src/lib/status.ts @@ -10,7 +10,7 @@ let i18n = Utils.getI18n() let getAllFilesName = function (): string[] { let outputArray = [''] - let files = walkSync.entries(path, {globs: ['**/*.md']}) + let files = walkSync.entries(path, { globs: ['**/*.md'] }) files.forEach(function (file) { let fileName = file.relativePath diff --git a/src/lib/update.ts b/src/lib/update.ts index 9035bd3..a75a0f3 100644 --- a/src/lib/update.ts +++ b/src/lib/update.ts @@ -15,9 +15,9 @@ function generateNewFileName (newIndex: number, title: string | any) { } function updateNameByTitle (): void { - let files = walkSync.entries(savePath, {globs: ['**/*.md'], ignore: ['README.md']}) + let files = walkSync.entries(savePath, { globs: ['**/*.md'], ignore: ['README.md'] }) - files.forEach( function (file) { + files.forEach(function (file) { let fileName = file.relativePath let fileData = fs.readFileSync(savePath + fileName, 'utf8') let firstLine = fileData.split('\n')[0] @@ -43,7 +43,7 @@ function updateNameByTitle (): void { } function updateToc (): void { - let toc = generate('toc', {output: false}) + let toc = generate('toc', { output: false }) fs.writeFileSync(savePath + 'README.md', toc) } diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 3a3bcc7..6c14bf7 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -33,7 +33,7 @@ function getMaxIndex (files: {relativePath: string}[]) { function getLatestIndex (): number { let path = Config.getSavePath() - let files = walkSync.entries(path, {globs: ['**/*.md']}) + let files = walkSync.entries(path, { globs: ['**/*.md'] }) if (!(files && files.length > 0)) { return 0 diff --git a/src/tests/search.spec.ts b/src/tests/search.spec.ts index 85a562c..cb2af09 100644 --- a/src/tests/search.spec.ts +++ b/src/tests/search.spec.ts @@ -28,7 +28,7 @@ let adrOptions = JSON.stringify({ test('ADR: list', t => { let findSpy = sinon.stub(findInFiles, 'find').returns({ then: cb => { - cb({'docs/adr/001-filename.md': {}}) + cb({ 'docs/adr/001-filename.md': {} }) } }) let ADRGetSavePathSpy = sinon.stub(Config, 'getSavePath').returns('./')