Skip to content

Commit

Permalink
修正 git 在切換 branch 時的錯誤
Browse files Browse the repository at this point in the history
  • Loading branch information
lekoOwO committed Aug 12, 2018
1 parent fbb887d commit 9f6fd69
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ git
if (branch != (config.PokaPlayer.debug ? 'dev' : 'master')) {
git
.fetch(["--all"])
.then(() => git.reset(["--hard", "origin/" + config.PokaPlayer.debug ? 'dev' : 'master']))
.then(() => git.checkout(config.PokaPlayer.debug ? 'dev' : 'master'))
.then(() => git.reset(["--hard", "origin/" + config.PokaPlayer.debug ? 'dev' : 'master']))
.then(process.exit)
.catch(err => {
console.error('failed: ', err)
Expand Down Expand Up @@ -124,6 +124,7 @@ io.on('connection', socket => {
git
.fetch(["--all"])
.then(() => socket.emit('git', 'fetch'))
.then(() => git.checkout(config.PokaPlayer.debug ? 'dev' : 'master'))
.then(() => git.reset(["--hard", "origin/" + config.PokaPlayer.debug ? 'dev' : 'master']))
.then(() => socket.emit('git', 'reset'))
.then(() => socket.emit('restart'))
Expand All @@ -144,6 +145,7 @@ app.get('/upgrade', (req, res) => {
if (!config.PokaPlayer.instantUpgradeProcess) {
git
.fetch(["--all"])
.then(() => git.checkout(config.PokaPlayer.debug ? 'dev' : 'master'))
.then(() => git.reset(["--hard", "origin/" + config.PokaPlayer.debug ? 'dev' : 'master']))
.then(() => res.send('upgrade'))
.then(() => process.exit())
Expand Down

1 comment on commit 9f6fd69

@lekoOwO
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#17

Please sign in to comment.