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
2929 ;;
3030esac
3131
32- while getopts " :b:c:M:" opt; do
32+ while getopts " :b:c:M:-: " opt; do
3333 case $opt in
3434 b)
3535 BITS=" $OPTARG " # 32, 64
@@ -55,6 +55,39 @@ while getopts ":b:c:M:" opt; do
5555 esac
5656done
5757
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+
5891# Default machine
5992if [[ -z " $MACHINE " ]]; then
6093 MACHINE=pc
You can’t perform that action at this time.
0 commit comments