From 3b1479394f18d8401e44ce7240add925ac128b6a Mon Sep 17 00:00:00 2001 From: 3y3 <3y3@ya.ru> Date: Sun, 11 Aug 2024 02:26:35 +0300 Subject: [PATCH] fix: Fix windows specific --- bin/lint | 2 +- scripts/modify-ignore.js | 5 +++-- scripts/modify-package.js | 6 ++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/bin/lint b/bin/lint index c5fbfd6..f6b017f 100755 --- a/bin/lint +++ b/bin/lint @@ -3,7 +3,7 @@ set -e BINDIR=$(dirname $0) -SRCDIR=$(dirname $(dirname $(node -pe "require('fs').realpathSync('$0')"))) +SRCDIR=$(dirname $(dirname $(node -pe "require('fs').realpathSync('$0').replace('\\', '/')"))) while (( $# )); do case "$1" in diff --git a/scripts/modify-ignore.js b/scripts/modify-ignore.js index 4369684..a48565a 100644 --- a/scripts/modify-ignore.js +++ b/scripts/modify-ignore.js @@ -1,4 +1,5 @@ -const {readFileSync, writeFileSync} = require('fs'); +const {join} = require('node:path'); +const {readFileSync, writeFileSync} = require('node:fs'); const SYSTEM = [ '.idea', @@ -49,7 +50,7 @@ const ignores = { }; for (const [file, list] of Object.entries(ignores)) { - const filename = process.cwd() + '/' + file; + const filename = join(process.cwd(), file); let source; try { diff --git a/scripts/modify-package.js b/scripts/modify-package.js index 862ef4e..6a64825 100644 --- a/scripts/modify-package.js +++ b/scripts/modify-package.js @@ -1,5 +1,7 @@ -const filename = process.cwd() + '/package.json'; -const {readFileSync, writeFileSync} = require('fs'); +const {join} = require('node:path'); +const {readFileSync, writeFileSync} = require('node:fs'); + +const filename = join(process.cwd(), 'package.json'); let pkg; try {