nextension
Advanced tools
Comparing version 2.2.1 to 2.2.11
@@ -24,7 +24,10 @@ #!/usr/bin/env node | ||
]; | ||
const maxCommandLength = Math.max(...commands.map(cmd => cmd.command.length)); | ||
const maxDescriptionLength = Math.max(...commands.map(cmd => cmd.description.length)); | ||
const totalWidth = maxCommandLength + maxDescriptionLength + 3; | ||
const bannerText = 'Globally use the command like: nextension [option] or if locally npx nextension [option]'; | ||
const totalWidth = bannerText.length + 2; | ||
const maxCommandLength = totalWidth / 2 - 1; | ||
const maxDescriptionLength = totalWidth / 2 - 1; | ||
const horizontalLine = '+' + '-'.repeat(totalWidth) + '+'; | ||
console.log(horizontalLine); | ||
console.log('|' + bannerText.padStart(totalWidth / 2 + bannerText.length / 2).padEnd(totalWidth) + '|'); | ||
console.log(horizontalLine); | ||
for (const cmd of commands) { | ||
@@ -31,0 +34,0 @@ console.log('|' + cmd.command.padEnd(maxCommandLength) + '|' + cmd.description.padEnd(maxDescriptionLength) + '|'); |
{ | ||
"name": "nextension", | ||
"version": "2.2.1", | ||
"version": "2.2.11", | ||
"description": "A CLI tool to build Next.js applications as Chrome extensions", | ||
@@ -5,0 +5,0 @@ "main": "dist/build.js", |
@@ -34,7 +34,10 @@ #!/usr/bin/env node | ||
]; | ||
const maxCommandLength = Math.max(...commands.map(cmd => cmd.command.length)); | ||
const maxDescriptionLength = Math.max(...commands.map(cmd => cmd.description.length)); | ||
const totalWidth = maxCommandLength + maxDescriptionLength + 3; | ||
const bannerText = 'Globally use the command like: nextension [option] or if locally npx nextension [option]'; | ||
const totalWidth = bannerText.length + 2; // Adding 2 for padding | ||
const maxCommandLength = totalWidth / 2 - 1; // Subtracting 1 for '|' | ||
const maxDescriptionLength = totalWidth / 2 - 1; // Subtracting 1 for '|' | ||
const horizontalLine = '+' + '-'.repeat(totalWidth) + '+'; | ||
console.log(horizontalLine); | ||
console.log('|' + bannerText.padStart(totalWidth/2 + bannerText.length/2).padEnd(totalWidth) + '|'); | ||
console.log(horizontalLine); | ||
for (const cmd of commands) { | ||
@@ -41,0 +44,0 @@ console.log('|' + cmd.command.padEnd(maxCommandLength) + '|' + cmd.description.padEnd(maxDescriptionLength) + '|'); |
Sorry, the diff of this file is not supported yet
81332
1357