mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-13 04:28:41 -09:00
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:
parent
6d68278b60
commit
3b1ec4e435
1 changed files with 12 additions and 12 deletions
|
|
@ -15,6 +15,18 @@ const devDir = resolve(__dirname, '../..');
|
||||||
const devCfg = join(devDir, cfgFile);
|
const devCfg = join(devDir, cfgFile);
|
||||||
const defaultCfg = resolve(__dirname, defaultCfgFile);
|
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 plugins = resolve(cfgDir, '.hyper_plugins');
|
||||||
const plugs = {
|
const plugs = {
|
||||||
base: plugins,
|
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 = {
|
module.exports = {
|
||||||
cfgDir, cfgPath, cfgFile, defaultCfg, icon, defaultPlatformKeyPath, plugs, yarn
|
cfgDir, cfgPath, cfgFile, defaultCfg, icon, defaultPlatformKeyPath, plugs, yarn
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue