Skip to content

Commit

Permalink
Make the code more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
decyjphr committed May 16, 2024
1 parent fab2b4a commit b922276
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions lib/plugins/repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,18 @@ module.exports = class Repository extends ErrorStash {
// So we'd have to rename it back to the oldname
if (res.data.name !== newname) {
return this.renameBranch(oldname, newname, resArray)
}
const parms = {
owner: this.settings.owner,
repo: this.settings.repo,
default_branch: newname
}
if (this.nop) {
resArray.push(new NopCommand(this.constructor.name, this.repo, this.github.repos.update.endpoint(parms), 'Update Repo'))
} else {
this.log.debug(`Updating repo with settings ${JSON.stringify(parms)}`)
return this.github.repos.update(parms)
const parms = {
owner: this.settings.owner,
repo: this.settings.repo,
default_branch: newname
}
if (this.nop) {
resArray.push(new NopCommand(this.constructor.name, this.repo, this.github.repos.update.endpoint(parms), 'Update Repo'))
} else {
this.log.debug(`Updating repo with settings ${JSON.stringify(parms)}`)
return this.github.repos.update(parms)
}
}
}).catch(e => {
if (e.status === 404) {
Expand Down

0 comments on commit b922276

Please sign in to comment.