Skip to content

Commit

Permalink
Fix server version strategies check
Browse files Browse the repository at this point in the history
  • Loading branch information
DEgITx committed Dec 11, 2018
1 parent 0dee20d commit 670f9c1
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/background/spider.js
Expand Up @@ -133,11 +133,18 @@ module.exports = function (send, recive, dataDirectory, version, env)
}

this.trackers = []
let strategies = require.context('./strategies', false, /\.js$/);
strategies.keys().forEach(strategie => {
this.trackers.push(new (strategies(strategie))(args))
logT('tracker', 'loaded strategie', strategie)
})
if(process.versions.electron) {
let strategies = require.context('./strategies', false, /\.js$/);
strategies.keys().forEach(strategie => {
this.trackers.push(new (strategies(strategie))(args))
logT('tracker', 'loaded strategie', strategie)
})
} else {
fs.readdirSync(__dirname + '/strategies').forEach((strategie) => {
this.trackers.push(new (require('./strategies/' + strategie))(args))
logT('tracker', 'loaded strategie', strategie)
})
}
}

findHash(hash, callback)
Expand Down

0 comments on commit 670f9c1

Please sign in to comment.