Skip to content

Commit

Permalink
Rename built in default plugin folder const
Browse files Browse the repository at this point in the history
  • Loading branch information
jamos-tay committed Mar 2, 2019
1 parent 1a4b7f0 commit f1722b8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Site.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const TEMPLATE_ROOT_FOLDER_NAME = 'template';
const TEMPLATE_SITE_ASSET_FOLDER_NAME = 'markbind';

const BUILT_IN_PLUGIN_FOLDER_NAME = 'plugins';
const BUILT_IN_PLUGIN_DEFAULT_FOLDER_NAME = 'plugins/default';
const BUILT_IN_DEFAULT_PLUGIN_FOLDER_NAME = 'plugins/default';
const FAVICON_DEFAULT_PATH = 'favicon.ico';
const FONT_AWESOME_PATH = 'asset/font-awesome.csv';
const FOOTER_PATH = '_markbind/footers/footer.md';
Expand Down Expand Up @@ -676,7 +676,7 @@ function getPluginPath(rootPath, plugin) {
}

// Check in default folder
const defaultPath = path.join(__dirname, BUILT_IN_PLUGIN_DEFAULT_FOLDER_NAME, `${plugin}.js`);
const defaultPath = path.join(__dirname, BUILT_IN_DEFAULT_PLUGIN_FOLDER_NAME, `${plugin}.js`);
if (fs.existsSync(defaultPath)) {
return defaultPath;
}
Expand All @@ -688,7 +688,7 @@ function getPluginPath(rootPath, plugin) {
* Finds plugins in the site's default plugin folder
*/
function findDefaultPlugins() {
const globPath = path.join(__dirname, BUILT_IN_PLUGIN_DEFAULT_FOLDER_NAME);
const globPath = path.join(__dirname, BUILT_IN_DEFAULT_PLUGIN_FOLDER_NAME);
if (!fs.existsSync(globPath)) {
return [];
}
Expand All @@ -712,7 +712,7 @@ Site.prototype.loadPlugin = function (plugin, isDefault) {
}

const pluginPath = getPluginPath(this.rootPath, plugin);
if (isDefault && !pluginPath.startsWith(path.join(__dirname, BUILT_IN_PLUGIN_DEFAULT_FOLDER_NAME))) {
if (isDefault && !pluginPath.startsWith(path.join(__dirname, BUILT_IN_DEFAULT_PLUGIN_FOLDER_NAME))) {
logger.warn(`Default plugin ${plugin} will be overridden`);
}

Expand Down

0 comments on commit f1722b8

Please sign in to comment.