Skip to content

Commit

Permalink
Review: fix undefined version & add running feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffersonRibeiro committed Jan 30, 2024
1 parent ca6c730 commit bfe959c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/generator-widget/bin.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
#!/usr/bin/env node

const { readFileSync } = require("fs");
var { join } = require("path");
const { execSync } = require("child_process");
const version = process.env.npm_package_version;
const chalk = require("chalk");

const packageJson = readFileSync(join(__dirname, "package.json"));
const version = JSON.parse(packageJson).version;
const args = process.argv.slice(2);

console.log(chalk.bold.blueBright("Running widget generator..."));
execSync(`npm install -g yo @mendix/generator-widget@${version}`);
execSync(`yo @mendix/widget@${version} ${args.join(" ")}`, { stdio: "inherit" });

0 comments on commit bfe959c

Please sign in to comment.