@@ -105,17 +105,6 @@ const yargsConf = yargs
105105
106106const argv = yargsConf . argv ;
107107
108- let dryRunMode = argv . dryRun || defaultDryRun ;
109- if ( argv . run ) {
110- dryRunMode = false ;
111- }
112- if ( dryRunMode ) {
113- console . log ( 'DRY RUN' . magenta ) ;
114- if ( defaultDryRun ) console . log ( 'For actual running of your command please add "--run" option' . yellow ) ;
115- }
116-
117- if ( argv . onlyDocs ) console . log ( 'Publish only documents' . magenta ) ;
118-
119108config . silent = ! argv . verbose ;
120109
121110const versionBumpOptions = {
@@ -125,13 +114,25 @@ const versionBumpOptions = {
125114} ;
126115
127116if ( versionBumpOptions . type === undefined && versionBumpOptions . preid === undefined ) {
128- console . log ( 'Must provide either a version bump type, preid ( or both) ' . red ) ;
117+ console . log ( 'Must provide either a version bump type, " preid" or "--only-docs" ' . red ) ;
129118 console . log ( yargsConf . help ( ) ) ;
130119 exit ( 1 ) ;
131120}
132121
133122let notesForRelease = argv . notes ;
134123
124+ let dryRunMode = argv . dryRun || defaultDryRun ;
125+ if ( argv . run ) {
126+ dryRunMode = false ;
127+ }
128+ if ( dryRunMode ) {
129+ console . log ( 'DRY RUN' . magenta ) ;
130+ if ( defaultDryRun ) console . log ( 'For actual running of your command please add "--run" option' . yellow ) ;
131+ }
132+
133+ if ( argv . preid ) console . log ( '"--preid" detected. Documents will not be published' . yellow ) ;
134+ if ( argv . onlyDocs && ! argv . preid ) console . log ( 'Publish only documents' . yellow ) ;
135+
135136
136137//------------------------------------------------------------------------------
137138// functions
@@ -395,7 +396,7 @@ function release({ type, preid, npmTagName }) {
395396 }
396397
397398 // documents site
398- if ( ! isPrivate && docsRepo ) {
399+ if ( ! isPrivate && ! preid && docsRepo ) {
399400 console . log ( 'Releasing: ' . cyan + 'documents site' . green ) ;
400401 releaseAdRepo ( docsRepo , docsRoot , tmpDocsRepo , vVersion ) ;
401402 console . log ( 'Documents site has been released' . green ) ;
0 commit comments