We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cc82fbd + bf90415 commit 7125624Copy full SHA for 7125624
src/autodev.ts
@@ -118,6 +118,16 @@ const autoDev = async (): Promise<void> => {
118
)
119
info(message)
120
}
121
+
122
+ // check if the branch exists, if not create it from base
123
+ const branchExists = await execAndSlurp(
124
+ `git ls-remote --heads origin ${branch}`
125
+ )
126
+ if (!branchExists) {
127
+ info(`Branch ${branch} does not exist. Creating branch from ${base}.`)
128
+ await exec(`git checkout -b ${branch} ${base}`)
129
+ await exec(`git push -u origin ${branch}`)
130
+ }
131
await exec(`git checkout -B ${branch}`)
132
133
// only push to defined branch if there are changes
0 commit comments