@@ -12,24 +12,30 @@ const log = debug("hardhat:core:tasks:console");
12
12
interface ConsoleActionArguments {
13
13
commands : string [ ] ;
14
14
history : string ;
15
+ noCompile : boolean ;
15
16
// We accept ReplOptions as an argument to allow tests overriding the IO streams
16
17
options ?: repl . ReplOptions ;
17
18
}
18
19
19
20
const consoleAction : NewTaskActionFunction < ConsoleActionArguments > = async (
20
- { commands, history, options } ,
21
+ { commands, history, noCompile , options } ,
21
22
hre ,
22
23
) => {
23
- return new Promise < REPLServer > ( async ( resolve ) => {
24
- // Resolve the history path if it is not empty
25
- let historyPath : string | undefined ;
26
- if ( history !== "" ) {
27
- const globalCacheDir = await getCacheDir ( ) ;
28
- historyPath = path . isAbsolute ( history )
29
- ? history
30
- : path . resolve ( globalCacheDir , history ) ;
31
- }
24
+ // Resolve the history path if it is not empty
25
+ let historyPath : string | undefined ;
26
+ if ( history !== "" ) {
27
+ const globalCacheDir = await getCacheDir ( ) ;
28
+ historyPath = path . isAbsolute ( history )
29
+ ? history
30
+ : path . resolve ( globalCacheDir , history ) ;
31
+ }
32
32
33
+ // If noCompile is false, run the compile task first
34
+ if ( ! noCompile ) {
35
+ // todo: run compile task
36
+ }
37
+
38
+ return new Promise < REPLServer > ( async ( resolve ) => {
33
39
// Start a new REPL server with the default options
34
40
const replServer = repl . start ( options ) ;
35
41
0 commit comments