diff --git a/package.json b/package.json index b5c1b643d1..fcafec919b 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ }, "scripts": { "test": "echo \"Error: no test specified\"", - "start": "./lib/bin/remixd.js", + "start": "./lib/bin/remixd.js -s ./shared --remix-ide http://127.0.0.1:8080", "npip": "npip", "lint": "eslint ./src --ext .ts", "build": "tsc -p ./ && chmod +x ./lib/bin/remixd.js", diff --git a/src/services/remixdClient.ts b/src/services/remixdClient.ts index e5d093ee4d..1aeeb1343b 100644 --- a/src/services/remixdClient.ts +++ b/src/services/remixdClient.ts @@ -94,7 +94,14 @@ export class RemixdClient extends PluginClient { } this.trackDownStreamUpdate[path] = path if (isFolder) { - fs.mkdirp(path).then(() => resolve()).catch((e: Error) => reject(e)) + fs.mkdirp(path).then(() => { + const splitPath = path.split('/') + splitPath.pop() + const parentDir = splitPath.join('/') + '/' + + this.emit('folderAdded', parentDir) + resolve() + }).catch((e: Error) => reject(e)) } else { fs.ensureFile(path).then(() => { fs.writeFile(path, args.content, 'utf8', (error: Error) => { diff --git a/src/utils.ts b/src/utils.ts index 1e5207c761..33e5e51d12 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -14,7 +14,9 @@ const pathModule = require('path') */ function absolutePath (path: string, sharedFolder:string): string { path = normalizePath(path) - if (path.indexOf(sharedFolder) !== 0) { + const exists = fs.existsSync('/' + path) + + if (!exists && path.indexOf(sharedFolder) !== 0) { path = pathModule.resolve(sharedFolder, path) } return path