Skip to content

Commit

Permalink
logs implementation done (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
HeeManSu authored Mar 4, 2024
1 parent ee48066 commit 336022c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"dependencies": {
"@metacall/protocol": "^0.1.19",
"busboy": "^1.4.0",
"colors": "^1.4.0",
"dotenv": "^16.0.3",
"express": "^4.18.2",
"git-clone": "^0.2.0",
Expand Down
15 changes: 10 additions & 5 deletions src/api.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { spawn } from 'child_process';
import colors from 'colors';
import { NextFunction, Request, Response } from 'express';
import { hostname } from 'os';
import * as path from 'path';

import { NextFunction, Request, Response } from 'express';

import upload from './controller/upload';

import {
Expand Down Expand Up @@ -34,6 +34,8 @@ import { appsDirectory } from './utils/config';

const appsDir = appsDirectory();

colors.enable();

export const callFnByName = (
req: Request,
res: Response,
Expand Down Expand Up @@ -220,9 +222,12 @@ export const deploy = catchAsync(
currentFile
});

// proc.stdout?.on('data', (data: Buffer) => {
// console.log('CP console log: -->>', data.toString());
// });
proc.stdout?.on('data', (data: Buffer) => {
console.log(data.toString().green);
});
proc.stderr?.on('data', (data: Buffer) => {
console.log(data.toString().red);
});

proc.on('message', (data: childProcessResponse) => {
if (data.type === protocol.g) {
Expand Down

0 comments on commit 336022c

Please sign in to comment.