File tree Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ case $PLATFORM in
29
29
;;
30
30
esac
31
31
32
- while getopts " :b:c:M:" opt; do
32
+ while getopts " :b:c:M:-: " opt; do
33
33
case $opt in
34
34
b)
35
35
BITS=" $OPTARG " # 32, 64
@@ -55,6 +55,39 @@ while getopts ":b:c:M:" opt; do
55
55
esac
56
56
done
57
57
58
+ # Get architecture from the `npm` environment variables to set the other ones
59
+ if [[ -z " $BITS " && -z " $CPU " && -z " $MACHINE " && -z " $NODE_ARCH " ]]; then
60
+ NODE_ARCH=$npm_config_arch
61
+ fi
62
+
63
+ case $NODE_ARCH in
64
+ " " )
65
+ ;;
66
+
67
+ arm)
68
+ CPU=cortex-a7
69
+ ;;
70
+
71
+ arm64)
72
+ CPU=cortex-a53
73
+ ;;
74
+
75
+ ia32)
76
+ BITS=32
77
+ MACHINE=pc
78
+ ;;
79
+
80
+ x64)
81
+ BITS=64
82
+ MACHINE=pc
83
+ ;;
84
+
85
+ * )
86
+ echo " Unknown architecture $NODE_ARCH "
87
+ exit 1
88
+ ;;
89
+ esac
90
+
58
91
# Default machine
59
92
if [[ -z " $MACHINE " ]]; then
60
93
MACHINE=pc
You can’t perform that action at this time.
0 commit comments