@@ -47,45 +47,6 @@ function copyRecursive(srcDir, dstDir) {
47
47
return results ;
48
48
}
49
49
50
- function arch ( ) {
51
- /**
52
- * On Windows, the most reliable way to detect a 64-bit OS from within a 32-bit
53
- * app is based on the presence of a WOW64 file: %SystemRoot%\SysNative.
54
- * See: https://twitter.com/feross/status/776949077208510464
55
- */
56
- if ( process . platform === "win32" ) {
57
- var useEnv = false ;
58
- try {
59
- useEnv = ! ! (
60
- process . env . SYSTEMROOT && fs . statSync ( process . env . SYSTEMROOT )
61
- ) ;
62
- } catch ( err ) { }
63
-
64
- var sysRoot = useEnv ? process . env . SYSTEMROOT : "C:\\Windows" ;
65
-
66
- // If %SystemRoot%\SysNative exists, we are in a WOW64 FS Redirected application.
67
- var isWOW64 = false ;
68
- try {
69
- isWOW64 = ! ! fs . statSync ( path . join ( sysRoot , "sysnative" ) ) ;
70
- } catch ( err ) { }
71
-
72
- return isWOW64 ? "x64" : "x86" ;
73
- }
74
-
75
- /**
76
- * On Linux, use the `getconf` command to get the architecture.
77
- */
78
- if ( process . platform === "linux" ) {
79
- var output = cp . execSync ( "getconf LONG_BIT" , { encoding : "utf8" } ) ;
80
- return output === "64\n" ? "x64" : "x86" ;
81
- }
82
-
83
- /**
84
- * If none of the above, assume the architecture is 32-bit.
85
- */
86
- return process . arch ;
87
- }
88
-
89
50
// implementing it b/c we don't want to depend on fs.copyFileSync which appears
90
51
91
52
function copyFileSync ( sourcePath , destPath ) {
@@ -105,7 +66,7 @@ function copyFileSync(sourcePath, destPath) {
105
66
var copyPlatformBinaries = ( platformPath , foldersToCopy ) => {
106
67
var platformBuildPath = path . join ( __dirname , platformPath ) ;
107
68
108
- let foldersToCopy , binariesToCopy ;
69
+ let binariesToCopy ;
109
70
110
71
binariesToCopy = Object . keys ( packageJson . bin ) . map ( function ( name ) {
111
72
return packageJson . bin [ name ] ;
@@ -150,14 +111,10 @@ try {
150
111
console . log ( "Could not create _export folder" ) ;
151
112
}
152
113
153
- const platformArch = arch ( ) ;
114
+ const platformArch = process . arch ;
154
115
switch ( platform ) {
155
116
case "win32" :
156
- if ( platformArch !== "x64" ) {
157
- console . warn ( "error: x86 is currently not supported on Windows" ) ;
158
- process . exit ( 1 ) ;
159
- }
160
- copyPlatformBinaries ( "platform-esy-npm-release-windows-x64" , [
117
+ copyPlatformBinaries ( "platform-esy-npm-release-win32-x64" , [
161
118
"bin" ,
162
119
"_export" ,
163
120
] ) ;
0 commit comments