Skip to content

Commit daaba51

Browse files
committed
Fixed remixd for windows
1 parent 021e7e2 commit daaba51

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

libs/remixd/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@remix-project/remixd",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "remix server: allow accessing file system from remix.ethereum.org and start a dev environment (see help section)",
55
"main": "index.js",
66
"types": "./index.d.ts",
@@ -40,7 +40,7 @@
4040
"@remixproject/plugin-utils": "^0.3.3",
4141
"@remixproject/plugin-ws": "^0.3.3",
4242
"axios": "^0.20.0",
43-
"chokidar": "^2.1.8",
43+
"chokidar": "^3.5.1",
4444
"commander": "^2.20.3",
4545
"fs-extra": "^3.0.1",
4646
"isbinaryfile": "^3.0.2",

libs/remixd/src/utils.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,15 @@ function walkSync (dir: string, filelist: Filelist, sharedFolder: string): Filel
4242
filelist = filelist || {}
4343
files.forEach(function (file) {
4444
const subElement = pathModule.join(dir, file)
45+
let isSymbolicLink
4546

46-
if (!fs.lstatSync(subElement).isSymbolicLink()) {
47+
try {
48+
isSymbolicLink = !fs.lstatSync(subElement).isSymbolicLink()
49+
} catch (error) {
50+
isSymbolicLink = false
51+
}
52+
53+
if (isSymbolicLink) {
4754
if (fs.statSync(subElement).isDirectory()) {
4855
filelist = walkSync(subElement, filelist, sharedFolder)
4956
} else {
@@ -62,8 +69,14 @@ function resolveDirectory (dir: string, sharedFolder: string): ResolveDirectory
6269

6370
files.forEach(function (file) {
6471
const subElement = pathModule.join(dir, file)
72+
let isSymbolicLink
6573

66-
if (!fs.lstatSync(subElement).isSymbolicLink()) {
74+
try {
75+
isSymbolicLink = !fs.lstatSync(subElement).isSymbolicLink()
76+
} catch (error) {
77+
isSymbolicLink = false
78+
}
79+
if (isSymbolicLink) {
6780
const relative: string = relativePath(subElement, sharedFolder)
6881

6982
ret[relative] = { isDirectory: fs.statSync(subElement).isDirectory() }

0 commit comments

Comments
 (0)