Skip to content

Commit

Permalink
fix: Fix windows specific
Browse files Browse the repository at this point in the history
  • Loading branch information
3y3 committed Aug 10, 2024
1 parent aeedb69 commit 2850d69
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
16 changes: 14 additions & 2 deletions bin/lint
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,20 @@

set -e

BINDIR=$(dirname $0)
SRCDIR=$(dirname $(dirname $(node -pe "require('fs').realpathSync('$0')")))
dirname --help
echo $0
echo $(dirname "$0")
TEST="${$0/\\/"\\\\"}"
TEST2="${$0/\\/"/"}"
echo $TEST
echo $TEST2
echo $(node -pe "'$0'.replace('\\\\', '/')")
echo $(node -pe "'$TEST'")
echo $(node -pe "'$TEST'.replace('\\\\', '/')")
echo $(node -pe "require('fs').realpathSync('$0').replace('\\\\', '/')")

BINDIR=$(dirname "$0")
SRCDIR=$(dirname $(dirname $(node -pe "require('fs').realpathSync('$0'.replace('\\\\', '/'))")))

while (( $# )); do
case "$1" in
Expand Down
5 changes: 3 additions & 2 deletions scripts/modify-ignore.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const {readFileSync, writeFileSync} = require('fs');
const {join} = require('node:path');
const {readFileSync, writeFileSync} = require('node:fs');

const SYSTEM = [
'.idea',
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 4 additions & 2 deletions scripts/modify-package.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down

0 comments on commit 2850d69

Please sign in to comment.