@@ -85,7 +85,7 @@ const utils = {
85
85
return parsed . version ;
86
86
} ,
87
87
88
- checkActiveVersion ( activeVersion , latest , opts = { } ) {
88
+ checkActiveVersion ( activeVersion , versionToUse , latestV1 , opts = { } ) {
89
89
const activeMajor = semver . major ( activeVersion ) ;
90
90
91
91
if ( opts . v1 && activeMajor > 1 ) {
@@ -96,19 +96,19 @@ const utils = {
96
96
} ) ;
97
97
}
98
98
99
- if ( semver . lte ( latest , activeVersion ) && ! opts . force ) {
99
+ if ( semver . lte ( versionToUse , activeVersion ) && ! opts . force ) {
100
100
return null ;
101
101
}
102
102
103
- if ( activeMajor === 1 && semver . diff ( activeVersion , latest ) === 'major' ) {
104
- const latestMajor = semver . major ( latest ) ;
103
+ if ( activeMajor === 1 && activeVersion !== latestV1 && semver . diff ( activeVersion , versionToUse ) === 'major' ) {
104
+ const majorToUse = semver . major ( versionToUse ) ;
105
105
throw new CliError ( {
106
- message : `You are trying to update to Ghost v${ latestMajor } , but your blog is not on the latest Ghost 1.0 version` ,
106
+ message : `You are trying to update to Ghost v${ majorToUse } , but your blog is not on the latest Ghost 1.0 version` ,
107
107
help : 'Instead run "ghost update --v1".'
108
108
} ) ;
109
109
}
110
110
111
- return latest ;
111
+ return versionToUse ;
112
112
} ,
113
113
114
114
async resolveVersion ( customVersion = null , activeVersion = null , opts = { } ) {
@@ -130,7 +130,7 @@ const utils = {
130
130
return latest ;
131
131
}
132
132
133
- return utils . checkActiveVersion ( activeVersion , latest , opts ) ;
133
+ return utils . checkActiveVersion ( activeVersion , latest , versions . latestMajor . v1 , opts ) ;
134
134
} ,
135
135
136
136
async versionFromZip ( zipPath , activeVersion = null , opts = { } ) {
0 commit comments