@@ -1040,28 +1040,38 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
10401040
10411041 let postUpdateConfigSnapshot = configSnapshot ;
10421042 if ( requestedChannel && configSnapshot . valid && requestedChannel !== storedChannel ) {
1043- const next = {
1044- ...configSnapshot . config ,
1045- update : {
1046- ...configSnapshot . config . update ,
1047- channel : requestedChannel ,
1048- } ,
1049- } ;
1050- await replaceConfigFile ( {
1051- nextConfig : next ,
1052- baseHash : configSnapshot . hash ,
1053- } ) ;
1054- postUpdateConfigSnapshot = {
1055- ...configSnapshot ,
1056- hash : undefined ,
1057- parsed : next ,
1058- sourceConfig : asResolvedSourceConfig ( next ) ,
1059- resolved : asResolvedSourceConfig ( next ) ,
1060- runtimeConfig : asRuntimeConfig ( next ) ,
1061- config : asRuntimeConfig ( next ) ,
1062- } ;
1063- if ( ! opts . json ) {
1064- defaultRuntime . log ( theme . muted ( `Update channel set to ${ requestedChannel } .` ) ) ;
1043+ if ( switchToGit ) {
1044+ if ( ! opts . json ) {
1045+ defaultRuntime . log (
1046+ theme . muted (
1047+ `Skipped persisting update.channel=${ requestedChannel } in the pre-update CLI process after switching to a git install.` ,
1048+ ) ,
1049+ ) ;
1050+ }
1051+ } else {
1052+ const next = {
1053+ ...configSnapshot . config ,
1054+ update : {
1055+ ...configSnapshot . config . update ,
1056+ channel : requestedChannel ,
1057+ } ,
1058+ } ;
1059+ await replaceConfigFile ( {
1060+ nextConfig : next ,
1061+ baseHash : configSnapshot . hash ,
1062+ } ) ;
1063+ postUpdateConfigSnapshot = {
1064+ ...configSnapshot ,
1065+ hash : undefined ,
1066+ parsed : next ,
1067+ sourceConfig : asResolvedSourceConfig ( next ) ,
1068+ resolved : asResolvedSourceConfig ( next ) ,
1069+ runtimeConfig : asRuntimeConfig ( next ) ,
1070+ config : asRuntimeConfig ( next ) ,
1071+ } ;
1072+ if ( ! opts . json ) {
1073+ defaultRuntime . log ( theme . muted ( `Update channel set to ${ requestedChannel } .` ) ) ;
1074+ }
10651075 }
10661076 }
10671077
0 commit comments