@@ -185,6 +185,7 @@ function IDEMessageHandler(client:SocketRuntimeClient, message) {
185
185
186
186
let content :string ;
187
187
let path :string ;
188
+ let isLocal = hash . indexOf ( "gist:" ) === 0 ;
188
189
189
190
// If we're in file mode, the only valid file to serve is the one specified in `config.path`.
190
191
if ( mode === Mode . file ) {
@@ -193,7 +194,7 @@ function IDEMessageHandler(client:SocketRuntimeClient, message) {
193
194
}
194
195
195
196
// Otherwise, anything goes. First we check if the client has requested a specific file in the URL hash.
196
- if ( mode === Mode . workspace && hash ) {
197
+ if ( ! isLocal && mode === Mode . workspace && hash ) {
197
198
// @FIXME : This code to strip the editor hash segment out really needs to be abstacted.
198
199
let filepath = hash . split ( "#" ) [ 0 ] ;
199
200
if ( filepath [ filepath . length - 1 ] === "/" ) filepath = filepath . slice ( 0 , - 1 ) ;
@@ -203,15 +204,15 @@ function IDEMessageHandler(client:SocketRuntimeClient, message) {
203
204
}
204
205
205
206
// If we've got a path to run with, use it as the default.
206
- if ( ! content && config . path ) {
207
+ if ( ! isLocal && ! content && config . path ) {
207
208
let workspace = "root" ;
208
209
// @FIXME : This hard-coding isn't technically wrong right now, but it's brittle and poor practice.
209
210
content = eveSource . get ( config . path , workspace ) ;
210
211
path = eveSource . getRelativePath ( config . path , workspace ) ;
211
212
}
212
213
213
214
// If we can't find the config path in a workspace, try finding it on disk.
214
- if ( ! content && config . path && fs . existsSync ( "." + path ) ) {
215
+ if ( ! isLocal && ! content && config . path && fs . existsSync ( "." + path ) ) {
215
216
content = fs . readFileSync ( "." + path ) . toString ( ) ;
216
217
}
217
218
0 commit comments