@@ -72,7 +72,7 @@ async function createVersionTag(customVersion = null, force = false) {
7272 }
7373 } else {
7474 console . log ( `⏭️ Tag ${ version } exists both locally and remotely. Skipping...` ) ;
75- console . log ( `💡 Use -- force to update the existing tag` ) ;
75+ console . log ( `💡 Use force-update to update the existing tag` ) ;
7676 return ;
7777 }
7878 } else if ( tagExistsLocally && ! tagExistsRemotely ) {
@@ -99,7 +99,7 @@ async function createVersionTag(customVersion = null, force = false) {
9999 }
100100 } else {
101101 console . log ( `🌐 Tag ${ version } exists remotely but not locally.` ) ;
102- console . log ( `💡 Use -- force to update the remote tag` ) ;
102+ console . log ( `💡 Use force-update to update the remote tag` ) ;
103103 return ;
104104 }
105105 } else {
@@ -190,16 +190,18 @@ async function updateVersionAndTag(type = 'patch') {
190190
191191// CLI interface
192192if ( require . main === module ) {
193+ console . log ( process . argv )
193194 const args = process . argv . slice ( 2 ) ;
194195 const command = args [ 0 ] ;
195196
196197 switch ( command ) {
197198 case 'tag' :
198199 // Create a tag with custom version or current version
199200 const customVersion = args [ 1 ] ;
200- const forceFlag = args . includes ( '--force' ) || args . includes ( '-f' ) ;
201+ const forceFlag = args . includes ( 'force-update' ) || args . includes ( '-f' ) ;
202+ console . log ( "🚀 ~ forceFlag:" , forceFlag )
201203
202- if ( customVersion && ( customVersion === '-- force' || customVersion === '-f' ) ) {
204+ if ( customVersion && ( customVersion === 'force-update ' || customVersion === '-f' ) ) {
203205 // If first argument is force flag, use package.json version with force
204206 createVersionTag ( null , true ) ;
205207 } else {
@@ -226,7 +228,7 @@ if (require.main === module) {
226228 default :
227229 console . log ( `
228230Usage:
229- npm run version:update tag [version] [-- force] - Create a tag using current or custom version
231+ npm run version:update tag [version] [force-update ] - Create a tag using current or custom version
230232 npm run version:update update [type] - Update version in package.json and create tag
231233
232234Version types:
@@ -235,18 +237,18 @@ Version types:
235237 major - Increment major version (X.0.0)
236238
237239Flags:
238- -- force, -f - Force recreate tag if it already exists locally
240+ force-update , -f - Force recreate tag if it already exists locally
239241
240242Examples:
241243 npm run version:update tag - Create tag ${ require ( './package.json' ) . version } (current version)
242244 npm run version:update tag 3.3.0 - Create tag v3.3.0 (custom version)
243- npm run version:update tag 3.3.0 -- force - Force recreate tag v3.3.0 (deletes local tag first)
244- npm run version:update tag -- force - Force recreate tag with current version
245+ npm run version:update tag 3.3.0 force-update - Force recreate tag v3.3.0 (deletes local tag first)
246+ npm run version:update tag force-update - Force recreate tag with current version
245247 npm run version:update update - Update to next patch and create tag
246248 npm run version:update update minor - Update to next minor and create tag
247249 npm run version:update update major - Update to next major and create tag
248250
249- Note: If you deleted a tag from GitHub but it still exists locally, use -- force flag
251+ Note: If you deleted a tag from GitHub but it still exists locally, use force-update flag
250252 ` ) ;
251253 break ;
252254 }
0 commit comments