diff --git a/package.json b/package.json index 378c21602ee..5f912b02622 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "url": "https://github.com/woocommerce/woocommerce/issues" }, "bin": { - "utils": "./tools/monorepo-utils/dist/index.js" + "utils": "./tools/monorepo-utils/bin/run" }, "scripts": { "build": "pnpm exec turbo run turbo:build", @@ -30,7 +30,7 @@ "create-extension": "node ./tools/create-extension/index.js", "cherry-pick": "node ./tools/cherry-pick/bin/run", "sync-dependencies": "pnpm exec syncpack -- fix-mismatches", - "utils": "./tools/monorepo-utils/dist/index.js" + "utils": "./tools/monorepo-utils/bin/run" }, "devDependencies": { "@babel/preset-env": "^7.20.2", diff --git a/tools/monorepo-utils/bin/run b/tools/monorepo-utils/bin/run new file mode 100755 index 00000000000..4c9974b2f94 --- /dev/null +++ b/tools/monorepo-utils/bin/run @@ -0,0 +1,5 @@ +#!/usr/bin/env node + +const { program } = require( '../dist/index' ); + +program.parse( process.argv ); diff --git a/tools/monorepo-utils/src/index.ts b/tools/monorepo-utils/src/index.ts index 2fb352fc639..b967a633f4b 100755 --- a/tools/monorepo-utils/src/index.ts +++ b/tools/monorepo-utils/src/index.ts @@ -1,4 +1,3 @@ -#! /usr/bin/env node /** * External dependencies */ @@ -9,9 +8,7 @@ import { Command } from '@commander-js/extra-typings'; */ import CodeFreeze from './code-freeze/commands'; -const program = new Command() +export const program = new Command() .name( 'utils' ) .description( 'Monorepo utilities' ) .addCommand( CodeFreeze ); - -program.parse( process.argv );