11// base code https://github.com/Caesar2011/rhinoder
22
3- import { readJsonSync , existsSync } from "https://deno.land/std/fs/mod.ts" ;
3+ import { existsSync } from "https://deno.land/std@0.74.0/fs/mod.ts" ;
4+
5+ import { readJsonSync } from "https://raw.githubusercontent.com/crewdevio/Trex/master/temp_deps/writeJson.ts" ;
46
57import { red , green , yellow } from "https://deno.land/std/fmt/colors.ts" ;
68
7- interface IrunJson {
9+ interface runJson {
810 config : {
911 [ key : string ] : string ;
1012 } ;
@@ -14,19 +16,19 @@ interface IrunJson {
1416/*
1517 * get object data from run file
1618 */
17- const data = readJsonSync ( "./run.json" ) as IrunJson ;
19+ const data = readJsonSync ( "./run.json" ) as runJson ;
1820
1921let throttle = 700 ;
2022let timeout : number | null = null ;
2123
2224let errorTrace : string [ ] = [ ] ;
2325
24- interface Icommands {
26+ interface Commands {
2527 name : string ;
2628 run : string [ ] ;
2729}
2830
29- const commands : Array < Icommands > = [ ] ;
31+ const commands : Array < Commands > = [ ] ;
3032
3133function logMessages ( ) {
3234 console . clear ( ) ;
@@ -58,8 +60,8 @@ if (existsSync("./run.json")) {
5860
5961 const entries = Object . entries ( data . config ) ;
6062
61- entries . forEach ( ( entrie ) => {
62- commands . push ( { name : entrie [ 0 ] , run : entrie [ 1 ] . split ( " " ) } ) ;
63+ entries . forEach ( ( entries ) => {
64+ commands . push ( { name : entries [ 0 ] , run : entries [ 1 ] . split ( " " ) } ) ;
6365 } ) ;
6466 }
6567} else {
@@ -82,7 +84,7 @@ commands.forEach(({ name }, index) => {
8284 }
8385} ) ;
8486
85- let taks : Deno . Process = startProcess ( args ) ;
87+ let task : Deno . Process = startProcess ( args ) ;
8688
8789function startProcess ( args : Array < string > ) : Deno . Process {
8890 if ( args . length < 1 ) {
@@ -94,8 +96,8 @@ function startProcess(args: Array<string>): Deno.Process {
9496function runApp ( ) {
9597 logMessages ( ) ;
9698
97- taks && taks . close ( ) ;
98- taks = startProcess ( args ) ;
99+ task && task . close ( ) ;
100+ task = startProcess ( args ) ;
99101}
100102
101103let files : string [ ] | string = data ?. files
0 commit comments