refactor: version-utils respects main (#29374)
This commit is contained in:
		
					parent
					
						
							
								f664f37793
							
						
					
				
			
			
				commit
				
					
						1373a030b4
					
				
			
		
					 1 changed files with 4 additions and 3 deletions
				
			
		| 
						 | 
					@ -65,8 +65,9 @@ async function nextNightly (v) {
 | 
				
			||||||
  const pre = `nightly.${getCurrentDate()}`;
 | 
					  const pre = `nightly.${getCurrentDate()}`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const branch = (await GitProcess.exec(['rev-parse', '--abbrev-ref', 'HEAD'], ELECTRON_DIR)).stdout.trim();
 | 
					  const branch = (await GitProcess.exec(['rev-parse', '--abbrev-ref', 'HEAD'], ELECTRON_DIR)).stdout.trim();
 | 
				
			||||||
  if (branch === 'master') {
 | 
					  // TODO(main-migration): Simplify once main branch is renamed
 | 
				
			||||||
    next = semver.inc(await getLastMajorForMaster(), 'major');
 | 
					  if (branch === 'master' || branch === 'main') {
 | 
				
			||||||
 | 
					    next = semver.inc(await getLastMajorForMain(), 'major');
 | 
				
			||||||
  } else if (isStable(v)) {
 | 
					  } else if (isStable(v)) {
 | 
				
			||||||
    next = semver.inc(next, 'patch');
 | 
					    next = semver.inc(next, 'patch');
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
| 
						 | 
					@ -74,7 +75,7 @@ async function nextNightly (v) {
 | 
				
			||||||
  return `${next}-${pre}`;
 | 
					  return `${next}-${pre}`;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
async function getLastMajorForMaster () {
 | 
					async function getLastMajorForMain () {
 | 
				
			||||||
  let branchNames;
 | 
					  let branchNames;
 | 
				
			||||||
  const result = await GitProcess.exec(['branch', '-a', '--remote', '--list', 'origin/[0-9]*-x-y'], ELECTRON_DIR);
 | 
					  const result = await GitProcess.exec(['branch', '-a', '--remote', '--list', 'origin/[0-9]*-x-y'], ELECTRON_DIR);
 | 
				
			||||||
  if (result.exitCode === 0) {
 | 
					  if (result.exitCode === 0) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue