Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 84ff90b

Browse files
committed
Print out building/updating logs to console
1 parent 01cb894 commit 84ff90b

File tree

4 files changed

+32
-9
lines changed

4 files changed

+32
-9
lines changed

‎src/Server.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default class Server {
3131
.use('/api', this.getApiRouter())
3232
.use(frontendMiddleware(this));
3333
if (this.webhook) {
34-
this.app.use('/webhook',this.webhook);
34+
this.app.use(this.webhook);
3535
}
3636
this.app.use(errorHandlerMiddleware());
3737

@@ -75,7 +75,11 @@ export default class Server {
7575

7676
async update(commit?: string) {
7777
await pull(rootDir, 'server', commit);
78-
await execute('npm install', {cwd: rootDir});
78+
await execute('npm install', {
79+
cwd: rootDir,
80+
stdout: process.stdout,
81+
stderr: process.stderr,
82+
});
7983
process.exit(0);
8084
};
8185

@@ -86,7 +90,11 @@ export default class Server {
8690
'npm run build',
8791
`rm -rf ${frontendBuiltDir}`,
8892
`mv ${frontendBuildDir} ${frontendBuiltDir}`,
89-
].join(' && '), {cwd: frontendDir});
93+
].join(' && '), {
94+
cwd: frontendDir,
95+
stdout: process.stdout,
96+
stderr: process.stderr,
97+
});
9098
}
9199

92100
start() {

‎src/middlewares/errorHandlerMiddleware.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function errorHandlerMiddleware() {
88
err = new InternalServerError(err.message, err);
99
}
1010

11-
const {name,message, status} = err;
12-
res.status(status).json({name,message, status});
11+
const {message, status} = err;
12+
res.status(status).send(message);
1313
};
1414
}

‎src/tracers/DockerTracer.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ export class DockerTracer extends Tracer {
2121

2222
build(release: Release) {
2323
const {tag_name} = release;
24-
return execute(`docker build -t ${this.imageName} . --build-arg tag_name=${tag_name}`, {cwd: this.directory});
24+
return execute(`docker build -t ${this.imageName} . --build-arg tag_name=${tag_name}`, {
25+
cwd: this.directory,
26+
stdout: process.stdout,
27+
stderr: process.stderr,
28+
});
2529
}
2630

2731
route(router: express.Router) {

‎src/utils/misc.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,22 @@ export function download(url: string, localPath: string) {
1717

1818
export async function pull(dir: string, repo: string, commit = 'origin/master') {
1919
if (fs.pathExistsSync(dir)) {
20-
await execute(`git fetch`, {cwd: dir});
20+
await execute(`git fetch`, {
21+
cwd: dir,
22+
stdout: process.stdout,
23+
stderr: process.stderr,
24+
});
2125
} else {
22-
await execute(`git clone https://github.com/algorithm-visualizer/${repo}.git ${dir}`);
26+
await execute(`git clone https://github.com/algorithm-visualizer/${repo}.git ${dir}`, {
27+
stdout: process.stdout,
28+
stderr: process.stderr,
29+
});
2330
}
24-
await execute(`git reset --hard ${commit}`, {cwd: dir});
31+
await execute(`git reset --hard ${commit}`, {
32+
cwd: dir,
33+
stdout: process.stdout,
34+
stderr: process.stderr,
35+
});
2536
}
2637

2738
export function getDescription(files: File[]) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /