Skip to content

Commit

Permalink
fix: plugins bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
coderosh committed Oct 17, 2020
1 parent 908e412 commit 6092e61
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v0.6.2

- Bug fix for plugins.
- Log whole error if error is due to plugins.

## v0.6.0 - v0.6.1

- Used remarkable to parser markdown.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ulka",
"version": "0.6.1",
"version": "0.6.2",
"description": "Ulka - A simpler static site generator written in JavaScript",
"main": "./src/index.js",
"bin": {
Expand Down
7 changes: 5 additions & 2 deletions src/utils/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,13 @@ const getPlugins = (pluginArr, cwd) => {
let options = {}

if (typeof plugin === "string") {
if (existsSync(cwd, plugin)) plugin = path.join(cwd, plugin)
if (existsSync(path.join(cwd, plugin))) {
plugin = path.join(cwd, plugin)
}

pPath = require.resolve(plugin)
} else if (typeof plugin === "object" && plugin.resolve) {
if (existsSync(cwd, plugin.resolve))
if (existsSync(path.join(cwd, plugin.resolve)))
plugin.resolve = path.join(cwd, plugin.resolve)

pPath = require.resolve(plugin.resolve)
Expand All @@ -155,6 +157,7 @@ const getPlugins = (pluginArr, cwd) => {

return plugins
} catch (e) {
console.log(e)
log.error("Error while getting plugins")
process.exit(0)
}
Expand Down

0 comments on commit 6092e61

Please sign in to comment.