From 8164f18e72feda4e2a256b83aba2b7c82465ed74 Mon Sep 17 00:00:00 2001 From: Eric Clemmons Date: Sat, 9 Mar 2019 17:28:16 -0800 Subject: [PATCH] Open entire folder + file when creating route --- packages/polydev/package.json | 2 +- packages/polydev/src/middleware/notFound/index.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/polydev/package.json b/packages/polydev/package.json index ff31046..bcc2734 100644 --- a/packages/polydev/package.json +++ b/packages/polydev/package.json @@ -1,6 +1,6 @@ { "name": "polydev", - "version": "1.4.0", + "version": "1.5.0", "bin": "./bin/polydev", "main": "./src/index.js", "repository": "git@github.com:ericclemmons/polydev.git", diff --git a/packages/polydev/src/middleware/notFound/index.js b/packages/polydev/src/middleware/notFound/index.js index 5cfa27c..9242756 100644 --- a/packages/polydev/src/middleware/notFound/index.js +++ b/packages/polydev/src/middleware/notFound/index.js @@ -1,3 +1,4 @@ +const { execSync } = require("child_process") const { stripIndent } = require("common-tags") const express = require("express") const jetpack = require("fs-jetpack") @@ -117,7 +118,7 @@ module.exports = express() await waitOn({ resources: [filepath] }, undefined) // Wait for the file to open - await opn(`vscode://file/${filepath}`, { wait: false }) + execSync(`code . -g ${filepath}`) // Reload the requested URL // ! Hopefully the router has been re-created by this point!