File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change 11use std:: {
22 fs,
3- path:: {
4- Path ,
5- PathBuf ,
6- } ,
3+ path:: PathBuf ,
74 time:: Duration ,
85} ;
96
@@ -34,6 +31,10 @@ use crate::executor::{
3431 EXECUTE_TIMEOUT_RESPONSE_JSON ,
3532} ;
3633
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+
3738pub struct LocalNodeExecutor {
3839 _source_dir : TempDir ,
3940 source_path : PathBuf ,
@@ -57,17 +58,7 @@ impl LocalNodeExecutor {
5758 "Using local node executor. Source: {}" ,
5859 source_path. to_str( ) . expect( "Path is not UTF-8 string?" ) ,
5960 ) ;
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 ( ) ;
7162
7263 // Look for node16 in a few places. CI nvm installer uses `mynvm`
7364 let mut node_path = "node" . to_string ( ) ;
You can’t perform that action at this time.
0 commit comments