File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
crates/volta-core/src/tool/node Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -129,10 +129,27 @@ impl Node {
129129 Node { version }
130130 }
131131
132+ #[ cfg( not( all( target_os = "macos" , target_arch = "aarch64" ) ) ) ]
132133 pub fn archive_basename ( version : & Version ) -> String {
133134 format ! ( "node-v{}-{}-{}" , version, NODE_DISTRO_OS , NODE_DISTRO_ARCH )
134135 }
135136
137+ #[ cfg( all( target_os = "macos" , target_arch = "aarch64" ) ) ]
138+ pub fn archive_basename ( version : & Version ) -> String {
139+ // Note: Node began shipping pre-built binaries for Apple Silicon with Major version 16
140+ // Prior to that, we need to fall back on the x64 binaries
141+ format ! (
142+ "node-v{}-{}-{}" ,
143+ version,
144+ NODE_DISTRO_OS ,
145+ if version. major >= 16 {
146+ NODE_DISTRO_ARCH
147+ } else {
148+ NODE_DISTRO_ARCH_FALLBACK
149+ }
150+ )
151+ }
152+
136153 pub fn archive_filename ( version : & Version ) -> String {
137154 format ! (
138155 "{}.{}" ,
You can’t perform that action at this time.
0 commit comments