-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcodebase.ts
More file actions
56 lines (41 loc) · 1.36 KB
/
codebase.ts
File metadata and controls
56 lines (41 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { spawn, exec } from 'child_process';
import { wait } from '.';
export async function upgradeCodebase() {
// Pull latest from Git
const execPromise = require('util').promisify(exec);
try {
await execPromise('rm .git/index.lock');
} catch (e2) {
console.log(e2);
}
const { stdout, stderr } = await execPromise('git add -A && git stash && git pull', { uid: 1000 });
console.log(stderr, stdout);
await wait(100);
}
export async function upgradeGsCodebase() {
// Pull latest from Git
const execPromise = require('util').promisify(exec);
// try {
// await execPromise('cd game-server && rm .git/index.lock', {uid: 1000})
// await wait(1000)
// } catch(e2) {
// console.log(e2)
// }
const { stdout, stderr } = await execPromise('cd game-server && git add -A && git stash && git pull origin master', {
uid: 1000,
});
console.log(stderr, stdout);
await wait(100);
}
export async function cloneGsCodebase(repoUri) {
// Pull latest from Git
const execPromise = require('util').promisify(exec);
// try {
// await execPromise('rm -rf game-server', {uid: 1000})
// } catch(e2) {
// console.log(e2)
// }
const { stdout, stderr } = await execPromise(`git clone ${repoUri} game-server`, { uid: 1000 }); // git@github.com:RuneFarm/rune-evolution-game-server.git
console.log(stderr, stdout);
await wait(100);
}