Skip to content

Commit 7ff239e

Browse files
committed
chore: enable the license setup in the cli
1 parent 4b86098 commit 7ff239e

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

.changeset/two-regions-dig.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"webtools-cli": patch
3+
---
4+
5+
chore: enable the license setup in the cli

packages/cli/src/commands/install.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { getAvailableAddons, getPremiumAddons } from '../utils/addons';
66
import { installPackage } from '../utils/package-manager';
77
import { logger } from '../utils/logger';
88
import { enableContentTypes } from './subcommands/enable-content-types';
9+
import { licenseSetup } from './subcommands/license-setup';
910

1011
export async function install() {
1112
// Check if we're in a Strapi project
@@ -20,11 +21,9 @@ export async function install() {
2021
`${chalk.bold('🚀 Let\'s build your new website with Strapi')}\n`,
2122
);
2223

23-
// console.log('🚀 Get more out of Webtools with premium add-ons!\n');
24+
console.log('🚀 Get more out of Webtools with premium add-ons!\n');
2425

25-
// const { licenseKey } = await licenseSetup();
26-
27-
const licenseKey = null;
26+
const { licenseKey } = await licenseSetup();
2827

2928
// Get available content types
3029
const contentTypes = getContentTypes();

packages/cli/src/index.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Command } from 'commander';
44
import chalk from 'chalk';
55
import { install } from './commands/install';
66
import { enable } from './commands/enable';
7+
import { setupLicense } from './commands/license-setup';
78

89
const program = new Command();
910

@@ -36,17 +37,16 @@ program
3637
}
3738
});
3839

39-
// program
40-
// .command('setup-license')
41-
// .description('Set up your Webtools license in your Strapi project')
42-
// .action(async () => {
43-
// try {
44-
// await setupLicense();
45-
// } catch (error) {
46-
// eslint-disable-next-line max-len
47-
// console.error(chalk.red('Error:'), error instanceof Error ? error.message : 'An unknown error occurred');
48-
// process.exit(1);
49-
// }
50-
// });
40+
program
41+
.command('setup-license')
42+
.description('Set up your Webtools license in your Strapi project')
43+
.action(async () => {
44+
try {
45+
await setupLicense();
46+
} catch (error) {
47+
console.error(chalk.red('Error:'), error instanceof Error ? error.message : 'An unknown error occurred');
48+
process.exit(1);
49+
}
50+
});
5151

5252
program.parse();

0 commit comments

Comments
 (0)