File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import { Messages } from '../messages';
10
10
import { Logger } from '../logger' ;
11
11
import { ConfigAggregator } from '../config/configAggregator' ;
12
12
import { SfProject } from '../sfProject' ;
13
- import { SfError } from '../sfError ' ;
13
+ import { Lifecycle } from '../lifecycleEvents ' ;
14
14
import { Org } from './org' ;
15
15
import {
16
16
authorizeScratchOrg ,
@@ -212,15 +212,16 @@ const getSignupTargetLoginUrl = async (): Promise<string | undefined> => {
212
212
const updateRevisionCounterToZero = async ( scratchOrg : Org ) : Promise < void > => {
213
213
const conn = scratchOrg . getConnection ( ) ;
214
214
const queryResult = await conn . tooling . sobject ( 'SourceMember' ) . find ( { RevisionCounter : { $gt : 0 } } , [ 'Id' ] ) ;
215
+ if ( queryResult . length === 0 ) {
216
+ return ;
217
+ }
215
218
try {
216
219
await conn . tooling
217
220
. sobject ( 'SourceMember' )
218
221
. update ( queryResult . map ( ( record ) => ( { Id : record . Id , RevisionCounter : 0 } ) ) ) ;
219
222
} catch ( err ) {
220
- const message = messages . getMessage ( 'SourceStatusResetFailureError' , [
221
- scratchOrg . getOrgId ( ) ,
222
- scratchOrg . getUsername ( ) ,
223
- ] ) ;
224
- throw new SfError ( message , 'SourceStatusResetFailure' ) ;
223
+ await Lifecycle . getInstance ( ) . emitWarning (
224
+ messages . getMessage ( 'SourceStatusResetFailureError' , [ scratchOrg . getOrgId ( ) , scratchOrg . getUsername ( ) ] )
225
+ ) ;
225
226
}
226
227
} ;
You can’t perform that action at this time.
0 commit comments