Skip to content

Commit

Permalink
Fix plugin path in dev mode (vercel#2192)
Browse files Browse the repository at this point in the history
When a dev config (<project_dir>/.hyper.js) is used, plugins should be searched/installed in <project_dir>/.hyper_plugins directory
  • Loading branch information
chabou authored and h93xV2 committed Sep 11, 2017
1 parent 6f48d2a commit dc5333e
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions app/config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
};

0 comments on commit dc5333e

Please sign in to comment.