Skip to content

Commit

Permalink
Added architecture detection, and rosetta warning
Browse files Browse the repository at this point in the history
  • Loading branch information
J0HNB0Y committed Jul 7, 2021
1 parent 8618884 commit 0f1a51e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 30 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ VERSION=v0.0.5 bash <(curl -sL https://raw.githubusercontent.com/HewlettPackard/

Before using the install script, install GNU grep via homebrew with `brew install grep`

Use the script `tools/install-hpegl-provider-macos.sh` (or `tools/install-hpegl-provider-macos-m1.sh` on an Apple Silicon machine) to automatically download and install hpegl provider:
**Please note: Running a terminal on Apple Silicon through Rosetta will return the wrong architecture for the machine, installing amd64 rather than arm64**

Use the script `tools/install-hpegl-provider-macos.sh` to automatically download and install hpegl provider:


```shell
bash <(curl -sL https://raw.githubusercontent.com/HewlettPackard/terraform-provider-hpegl/main/tools/install-hpegl-provider-macos.sh)
Expand Down
28 changes: 0 additions & 28 deletions tools/install-hpegl-provider-macos-m1.sh

This file was deleted.

12 changes: 11 additions & 1 deletion tools/install-hpegl-provider-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@
set -e

os="darwin"
arch="amd64"

if [[ `uname -m` == 'x86_64']]
then
echo 'Intel Architecture detected'
arch="amd64"
elif [[ `uname -m` == 'arm64' ]]
then
echo 'Apple Silicon Architecture detected'
arch="arm64"
fi

repo="HewlettPackard/terraform-provider-hpegl"
macos_hpegl_dir="${HOME}/.terraform.d/plugins/registry.terraform.io/hewlettpackard/hpegl"

Expand Down

0 comments on commit 0f1a51e

Please sign in to comment.