From 7eea3e92a9084736455f791c23b3dc81cf28cec3 Mon Sep 17 00:00:00 2001 From: Ivan Gagarinov Date: Tue, 2 Jul 2024 15:21:54 +0500 Subject: [PATCH] fixes --- Makefile | 2 +- bin/fix.js | 2 +- src/index.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 3186772..ae90e7b 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ check: run-fix: docker run --rm \ -v ./fixtures:/content \ - -v ./bin:/usr/local/bin \ + -v ./bin:/LanguageTool-6.3/bin \ -v ./src:/LanguageTool-6.3/src \ hexlet/languagetool-cli \ node ./bin/fix.js diff --git a/bin/fix.js b/bin/fix.js index b677a41..4e117b3 100644 --- a/bin/fix.js +++ b/bin/fix.js @@ -5,7 +5,7 @@ import { fix } from '../src/index.js'; exec('sh /LanguageTool-6.3/start.sh >/dev/null 2>&1 &', () => setTimeout(() => { const rules = process.argv.slice(2); - fix(rules).then(() => { + fix('/content', rules).then(() => { console.log('------------------DONE-----------------'); }); }, 5000)); diff --git a/src/index.js b/src/index.js index 6c9a352..139774a 100644 --- a/src/index.js +++ b/src/index.js @@ -112,8 +112,8 @@ const checkTree = (source, rules) => { return iter(source); } -const fix = async (rules = []) => { - const filePaths = await getFilePaths(); +const fix = async (dirPath, rules = []) => { + const filePaths = await getFilePaths(dirPath); const promises = filePaths.map(async (fullpath) => { const content = fs.readFileSync(fullpath, 'utf-8'); const fileName = fullpath.split('/').slice(2).join('/');