Fix plugin path in dev mode (#2192)

When a dev config (<project_dir>/.hyper.js) is used, plugins should be searched/installed in <project_dir>/.hyper_plugins directory
This commit is contained in:
CHaBou 2017-09-11 01:20:52 +02:00 committed by Philippe Potvin
parent 6d68278b60
commit 3b1ec4e435

View file

@ -15,6 +15,18 @@ const devDir = resolve(__dirname, '../..');
const devCfg = join(devDir, cfgFile);
const defaultCfg = resolve(__dirname, defaultCfgFile);
if (isDev) {
// if a local config file exists, use it
try {
statSync(devCfg);
cfgPath = devCfg;
cfgDir = devDir;
console.log('using config file:', cfgPath);
} catch (err) {
// ignore
}
}
const plugins = resolve(cfgDir, '.hyper_plugins');
const plugs = {
base: plugins,
@ -39,18 +51,6 @@ const defaultPlatformKeyPath = () => {
}
};
if (isDev) {
// if a local config file exists, use it
try {
statSync(devCfg);
cfgPath = devCfg;
cfgDir = devDir;
console.log('using config file:', cfgPath);
} catch (err) {
// ignore
}
}
module.exports = {
cfgDir, cfgPath, cfgFile, defaultCfg, icon, defaultPlatformKeyPath, plugs, yarn
};