@@ -2,7 +2,7 @@ import { createChangelog } from '../changelog';
22import { GitNewTag , LogOptions } from '../types' ;
33import { lastTag , setVersion , setTag , newCommits , isValidTag , pushCommits } from '../git' ;
44import { success , error , getHeader } from '../console' ;
5- import { existsConfig , getFile , getLernaRoot } from '../utils' ;
5+ import { existsConfig , getFile , getLernaRoot , isPrerelease } from '../utils' ;
66import { getGeneriConfig } from '../generi' ;
77import { publish } from '../npm' ;
88import { nextTag } from '../tag' ;
@@ -46,12 +46,14 @@ export const setup = (tag: GitNewTag, options: LogOptions) => {
4646
4747 const last = lerna ? 'v' + JSON . parse ( lerna ) . version : lastTag ( ) ;
4848
49+ const prerelease = isPrerelease ( tag )
50+ ? options ?. git ?. prerelease ?? config . prerelease ?? 'beta'
51+ : undefined ;
52+
4953 const next = nextTag ( {
5054 last,
5155 tag,
52- prerelease : tag . startsWith ( 'pre' )
53- ? options ?. git ?. prerelease ?? config . prerelease
54- : undefined ,
56+ prerelease,
5557 } ) ;
5658
5759 if ( ! next ) {
@@ -62,7 +64,7 @@ export const setup = (tag: GitNewTag, options: LogOptions) => {
6264 if ( config . version ) {
6365 success ( `${ last } to ${ next } (${ tag . toUpperCase ( ) } )` ) ;
6466
65- setVersion ( next , tag ) ;
67+ setVersion ( next , tag , prerelease ) ;
6668 }
6769
6870 createChangelog ( ! config . version ? lastTag ( ) : next ) ;
0 commit comments