File tree 1 file changed +6
-15
lines changed
1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change 1
1
use std:: {
2
2
fs,
3
- path:: {
4
- Path ,
5
- PathBuf ,
6
- } ,
3
+ path:: PathBuf ,
7
4
time:: Duration ,
8
5
} ;
9
6
@@ -34,6 +31,10 @@ use crate::executor::{
34
31
EXECUTE_TIMEOUT_RESPONSE_JSON ,
35
32
} ;
36
33
34
+ /// Always use node version specified in .nvmrc for lambda execution, even if
35
+ /// we're using older version for CLI.
36
+ const NODE_VERSION : & str = include_str ! ( "../../../.nvmrc" ) ;
37
+
37
38
pub struct LocalNodeExecutor {
38
39
_source_dir : TempDir ,
39
40
source_path : PathBuf ,
@@ -57,17 +58,7 @@ impl LocalNodeExecutor {
57
58
"Using local node executor. Source: {}" ,
58
59
source_path. to_str( ) . expect( "Path is not UTF-8 string?" ) ,
59
60
) ;
60
- let repo_root = Path :: new ( env ! ( "CARGO_MANIFEST_DIR" ) )
61
- . parent ( )
62
- . unwrap ( )
63
- . parent ( )
64
- . unwrap ( ) ;
65
-
66
- // Always use node version specified in .nvmrc for lambda execution, even if
67
- // we're using older version for CLI.
68
- let node_version = fs:: read_to_string ( repo_root. join ( ".nvmrc" ) ) ?
69
- . trim ( )
70
- . to_string ( ) ;
61
+ let node_version = NODE_VERSION . trim ( ) ;
71
62
72
63
// Look for node16 in a few places. CI nvm installer uses `mynvm`
73
64
let mut node_path = "node" . to_string ( ) ;
You can’t perform that action at this time.
0 commit comments