@@ -7,7 +7,7 @@ import chalk from "chalk";
7
7
const currentFilePath = import . meta. url ;
8
8
const currentFileFolder = path . dirname ( currentFilePath ) . replace ( "file:" , "" ) ;
9
9
10
- export function callTsProxy ( tsCode ) {
10
+ export function callTsProxy ( tsCode , silent = false ) {
11
11
12
12
process . env . HEAVY_DEBUG && console . log ( "🌐 Calling tsproxy with code:" , path . join ( currentFileFolder , "proxy.ts" ) ) ;
13
13
return new Promise ( ( resolve , reject ) => {
@@ -30,9 +30,11 @@ export function callTsProxy(tsCode) {
30
30
if ( code === 0 ) {
31
31
try {
32
32
const parsed = JSON . parse ( stdout ) ;
33
- parsed . capturedLogs . forEach ( ( log ) => {
34
- console . log ( ...log ) ;
35
- } ) ;
33
+ if ( ! silent ) {
34
+ parsed . capturedLogs . forEach ( ( log ) => {
35
+ console . log ( ...log ) ;
36
+ } ) ;
37
+ }
36
38
37
39
if ( parsed . error ) {
38
40
reject ( new Error ( `${ parsed . error } \n${ parsed . stack } ` ) ) ;
@@ -73,13 +75,13 @@ export async function findAdminInstance() {
73
75
const fileNoTs = file . replace ( / \. t s $ / , "" ) ;
74
76
process . env . HEAVY_DEBUG && console . log ( `🪲 Trying bundleing ${ file } ...` ) ;
75
77
try {
76
- res = await callTsProxy ( `
78
+ const res = await callTsProxy ( `
77
79
import { admin } from './${ fileNoTs } .js';
78
80
79
81
export async function exec() {
80
82
return admin.formatAdminForth();
81
83
}
82
- ` ) ;
84
+ ` , true ) ;
83
85
instanceFound . file = fileNoTs ;
84
86
instanceFound . version = res ;
85
87
break ;
0 commit comments