File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed
railties/lib/rails/generators Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ class AppBase < Base # :nodoc:
15
15
include Database
16
16
include AppName
17
17
18
+ NODE_TLS_VERSION = "18.15.0"
19
+
18
20
attr_accessor :rails_template
19
21
add_shebang_option!
20
22
@@ -458,10 +460,14 @@ def using_node?
458
460
options [ :javascript ] && options [ :javascript ] != "importmap"
459
461
end
460
462
461
- def dockerfile_node_version
462
- using_node? and `node --version` [ /\d +\. \d +\. \d +/ ]
463
- rescue
464
- "lts"
463
+ def node_version
464
+ if using_node?
465
+ ENV . fetch ( "NODE_VERSION" ) do
466
+ `node --version` [ /\d +\. \d +\. \d +/ ]
467
+ rescue
468
+ NODE_TLS_VERSION
469
+ end
470
+ end
465
471
end
466
472
467
473
def dockerfile_yarn_version
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ RUN apt-get update -qq && \
23
23
24
24
<% if using_node? -%>
25
25
# Install JavaScript dependencies
26
- ARG NODE_VERSION=<%= dockerfile_node_version %>
26
+ ARG NODE_VERSION=<%= node_version %>
27
27
ARG YARN_VERSION=<%= dockerfile_yarn_version %>
28
28
ENV PATH=/usr/local/node/bin:$PATH
29
29
RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz -C /tmp/ && \
Original file line number Diff line number Diff line change 1
- <%= ENV["NODE_VERSION"] || dockerfile_node_version %>
1
+ <%= node_version %>
You can’t perform that action at this time.
0 commit comments