Skip to content

Commit

Permalink
fix: fixed marko resolver for Windows (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
melquan authored and oxala committed May 24, 2019
1 parent 0d7c8d1 commit 35c6c17
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/versions.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
const getModulePath = moduleName => require.resolve(`${moduleName}/package.json`).replace(/\/package\.json$/, '');
const { join } = require('path');

const getModulePath = moduleName => require.resolve(join(moduleName, 'package.json')).replace(join(' ', 'package.json').substr(1), '');
const markoPath = getModulePath('marko');
/* eslint-disable-next-line global-require, import/no-dynamic-require */
const { version: markoVersion } = require(`${markoPath}/package`);
const { version: markoVersion } = require(join(markoPath, 'package'));
let markoWidgetsPath;
let markoWidgetsVersion;

try {
markoWidgetsPath = getModulePath('marko-widgets');
/* eslint-disable-next-line global-require, import/no-dynamic-require */
markoWidgetsVersion = require(`${markoWidgetsPath}/package`).version;
markoWidgetsVersion = require(join(markoWidgetsPath, 'package')).version;
} catch (error) { /* */ }

module.exports = {
Expand Down

0 comments on commit 35c6c17

Please sign in to comment.