From d83ba2ff1be22a73fd5a07eb114ec3ccdd9da7ff Mon Sep 17 00:00:00 2001 From: Josh Manders Date: Thu, 6 Apr 2023 09:15:20 -0500 Subject: [PATCH] fix: resolving of maizzle framework --- src/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index aa777ee..97b4473 100644 --- a/src/index.js +++ b/src/index.js @@ -44,12 +44,12 @@ module.exports = () => { .option('-b, --bin [bin]', 'path to the maizzle executable') .description('compile email templates and output them to disk') .action(async (env, options) => { - const bin = options.bin || './node_modules/@maizzle/framework/src' + const bin = options.bin || require.resolve('@maizzle/framework/src') await importCwd(bin).build(env) updateNotifier({ - pkg: importCwd('./node_modules/@maizzle/framework/package.json'), + pkg: importCwd(require.resolve('@maizzle/framework/package.json')), shouldNotifyInNpmScript: true, }).notify() }) @@ -60,7 +60,7 @@ module.exports = () => { .option('-nc, --noclear [noclear]', 'do not clear the console log') .description('start a local development server and watch for file changes') .action((env, options) => { - const bin = options.bin || './node_modules/@maizzle/framework/src' + const bin = options.bin || require.resolve('@maizzle/framework/src') importCwd(bin).serve(env, { build: { @@ -80,7 +80,7 @@ module.exports = () => { const pkg = require('../package.json') try { - const maizzle = importCwd('./node_modules/@maizzle/framework/package.json') + const maizzle = importCwd(require.resolve('@maizzle/framework/package.json')) console.log(`Framework v${maizzle.version}\nCLI v${pkg.version}`) } catch { console.log(`CLI v${pkg.version}\nTo see your Framework version, run this command in the root directory of a Maizzle project.`)