Skip to content

Commit

Permalink
feat(Standalone): Support installation on M1-based Macs
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrzesik committed Dec 8, 2021
1 parent f358585 commit 92ae054
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/utils/standalone.js
Expand Up @@ -17,7 +17,12 @@ const arch = (() => {
case 'x32':
return 'x86';
case 'arm':
return 'armv6';
case 'arm64':
if (process.platform === 'darwin') {
// Handle case of M1 Macs that are using x64 binary via Rosetta
return 'x64';
}
return 'armv6';
default:
return process.arch;
Expand Down
3 changes: 3 additions & 0 deletions scripts/pkg/install.sh
Expand Up @@ -30,6 +30,9 @@ fi
MACHINE_TYPE=`uname -m`
if [[ $MACHINE_TYPE == "x86_64" ]]; then
ARCH='x64'
elif [[ $OSTYPE == "darwin"* ]] && [[ $MACHINE_TYPE == "arm64" ]]; then
ARCH='x64'
echo "There is no native binary installer available for $MACHINE_TYPE architecture. Version for x86_64 architecture will be installed instead. In order to use it, you need to have Rosetta installed."
else
echo "$red Sorry, there's no serverless binary installer available for $MACHINE_TYPE architecture. Please open request for it at https://github.com/serverless/serverless/issues.$reset"
exit 1
Expand Down

0 comments on commit 92ae054

Please sign in to comment.