add check for imported file

pull/3094/head
yann300 7 years ago
parent c8953afc5d
commit eca5d1e2a0
  1. 9
      src/app/files/fileManager.js

@ -4,6 +4,7 @@ var $ = require('jquery')
var remixLib = require('remix-lib') var remixLib = require('remix-lib')
var yo = require('yo-yo') var yo = require('yo-yo')
var EventManager = remixLib.EventManager var EventManager = remixLib.EventManager
var imports = require('../compiler/compiler-imports')
/* /*
attach to files event (removed renamed) attach to files event (removed renamed)
@ -145,8 +146,14 @@ class FileManager {
fileProviderOf (file) { fileProviderOf (file) {
var provider = file.match(/[^/]*/) var provider = file.match(/[^/]*/)
if (provider !== null) { if (provider !== null && this.opt.filesProviders[provider[0]]) {
return this.opt.filesProviders[provider[0]] return this.opt.filesProviders[provider[0]]
} else {
for (var handler of imports.handlers()) {
if (handler.match.exec(file)) {
return this.opt.filesProviders[handler.type]
}
}
} }
return null return null
} }

Loading…
Cancel
Save