Skip to content

Commit

Permalink
feat: use master as destination
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesalexandre committed Jan 8, 2024
1 parent 7ea35da commit 22d11df
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scripts/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const assertIsCleanRepo = async () => {

const getCommitsList = async () => {
const log = await git().log({
from: 'main',
from: 'master',
to: 'develop',
})
return log.all.map(commit => `${commit.hash} - ${commit.message}`)
Expand All @@ -26,7 +26,7 @@ const inquireProceedWithCommits = async (commits: string[]) => {
{
type: 'confirm',
name: 'shouldProceed',
message: 'Do you want to merge and push these commits into main?',
message: 'Do you want to merge and push these commits into master?',
default: true,
},
]
Expand All @@ -39,7 +39,7 @@ const mergeAndPush = async () => {

console.log(chalk.green('Fetching latest changes...'))
await git().fetch(['origin', 'develop'])
await git().fetch(['origin', 'main'])
await git().fetch(['origin', 'master'])

const commits = await getCommitsList()

Expand All @@ -49,19 +49,19 @@ const mergeAndPush = async () => {
exit()
}

console.log(chalk.green('Checking out main...'))
await git().checkout(['main'])
console.log(chalk.green('Checking out master...'))
await git().checkout(['master'])

console.log(chalk.green('Merging develop into main...'))
console.log(chalk.green('Merging develop into master...'))
try {
await git().merge(['develop'])
} catch (error) {
console.error(chalk.red('Merge conflict encountered.'))
exit()
}

console.log(chalk.green('Pushing main to remote...'))
await git().push(['origin', 'main'])
console.log(chalk.green('Pushing master to remote...'))
await git().push(['origin', 'master'])
console.log(chalk.green('Merge and push completed successfully.'))
}

Expand Down

0 comments on commit 22d11df

Please sign in to comment.