From 9f6fd69f8999a163c0fbf6ac2b4802f2c755f4d0 Mon Sep 17 00:00:00 2001 From: Rex Tseng Date: Mon, 13 Aug 2018 01:12:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20git=20=E5=9C=A8=E5=88=87?= =?UTF-8?q?=E6=8F=9B=20branch=20=E6=99=82=E7=9A=84=E9=8C=AF=E8=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index ab5cce47..29815c4a 100644 --- a/index.js +++ b/index.js @@ -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) @@ -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')) @@ -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())