Skip to content

Commit

Permalink
fix: git branch
Browse files Browse the repository at this point in the history
  • Loading branch information
lekoOwO committed Dec 29, 2022
1 parent 9f2ac78 commit 462d1c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,28 +77,26 @@ if (config.PokaPlayer.debug) {
// 檢查 branch
git.raw(["symbolic-ref", "--short", "HEAD"]).then(branch => {
branch = branch.slice(0, -1); // 結果會多一個換行符
if (branch != (config.PokaPlayer.debug ? "dev" : "master")) {
if (branch != (config.PokaPlayer.debug ? "dev" : "master-3")) {
git.fetch(["--all"])
.then(() =>
git.reset(["--hard", "origin/" + (config.PokaPlayer.debug ? "dev" : "master")])
git.reset(["--hard", "origin/" + (config.PokaPlayer.debug ? "dev" : "master-3")])
)
.then(() => git.checkout(config.PokaPlayer.debug ? "dev" : "master"))
.then(() => git.checkout(config.PokaPlayer.debug ? "dev" : "master-3"))
.then(() => process.exit())
.catch(err => {
console.error("failed: ", err);
socket.emit("err", err.toString());
});
}
});

//
app.use(express.json());
app.use(express.static("public"))
app.use(helmet({ contentSecurityPolicy: false, }))
app.use(compression())
// disable X-Powered-By
app.set('x-powered-by', false);
//session
// session
app.use(session)
io.use(sharedsession(session, {
autoSave: true
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pokaplayer",
"version": "3.8.1",
"version": "3.8.2",
"description": "",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 462d1c0

Please sign in to comment.