Skip to content

Commit

Permalink
add check for imported file
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 committed Jan 3, 2018
1 parent 96eef93 commit ac8fedd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/app/files/fileManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var $ = require('jquery')
var remixLib = require('remix-lib')
var yo = require('yo-yo')
var EventManager = remixLib.EventManager
var imports = require('../compiler/compiler-imports')

/*
attach to files event (removed renamed)
Expand Down Expand Up @@ -145,8 +146,14 @@ class FileManager {

fileProviderOf (file) {
var provider = file.match(/[^/]*/)
if (provider !== null) {
if (provider !== null && 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
}
Expand Down

0 comments on commit ac8fedd

Please sign in to comment.