Fixed remixd for windows

pull/839/head
ioedeveloper 4 years ago
parent 021e7e2ca5
commit daaba514fb
  1. 4
      libs/remixd/package.json
  2. 17
      libs/remixd/src/utils.ts

@ -1,6 +1,6 @@
{
"name": "@remix-project/remixd",
"version": "0.3.0",
"version": "0.3.1",
"description": "remix server: allow accessing file system from remix.ethereum.org and start a dev environment (see help section)",
"main": "index.js",
"types": "./index.d.ts",
@ -40,7 +40,7 @@
"@remixproject/plugin-utils": "^0.3.3",
"@remixproject/plugin-ws": "^0.3.3",
"axios": "^0.20.0",
"chokidar": "^2.1.8",
"chokidar": "^3.5.1",
"commander": "^2.20.3",
"fs-extra": "^3.0.1",
"isbinaryfile": "^3.0.2",

@ -42,8 +42,15 @@ function walkSync (dir: string, filelist: Filelist, sharedFolder: string): Filel
filelist = filelist || {}
files.forEach(function (file) {
const subElement = pathModule.join(dir, file)
let isSymbolicLink
if (!fs.lstatSync(subElement).isSymbolicLink()) {
try {
isSymbolicLink = !fs.lstatSync(subElement).isSymbolicLink()
} catch (error) {
isSymbolicLink = false
}
if (isSymbolicLink) {
if (fs.statSync(subElement).isDirectory()) {
filelist = walkSync(subElement, filelist, sharedFolder)
} else {
@ -62,8 +69,14 @@ function resolveDirectory (dir: string, sharedFolder: string): ResolveDirectory
files.forEach(function (file) {
const subElement = pathModule.join(dir, file)
let isSymbolicLink
if (!fs.lstatSync(subElement).isSymbolicLink()) {
try {
isSymbolicLink = !fs.lstatSync(subElement).isSymbolicLink()
} catch (error) {
isSymbolicLink = false
}
if (isSymbolicLink) {
const relative: string = relativePath(subElement, sharedFolder)
ret[relative] = { isDirectory: fs.statSync(subElement).isDirectory() }

Loading…
Cancel
Save