-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat
: support arm64 architecture
#18
base: main
Are you sure you want to change the base?
Conversation
@eduardoleolim Could you check if this script properly installs the aarch64 version of Zen on a ARM machine? bash <(curl -s https://raw.githubusercontent.com/sannidhyaroy/updates-server/refs/heads/feat/arch/install.sh) The PR should be ready, if it's working as expected... |
@sannidhyaroy , I noticed an error. If there is a case where the output of I think the download url must be built after switch statement |
Right, forgot about that completely. Thanks, I'll push a fix soon! |
That should work now. |
It works but I think it could be better set -euo pipefail
os_arch=$(uname -m)
... Variables initialized here
# Delete initialization of official_package_location in line 10
... Other variables initialized here
...
case "$os_arch" in
x86_64) echo "64-bit (Intel/AMD) architecture identified!" ;;
aarch64|arm64)
echo "64-bit ARM architecture identified!"
os_arch="aarch64" # Update os_arch to ensure valid value for download url. Another option could be extract arm64 to another case of switch statement
*)
echo "Zen doesn't support this architecture: $os_arch"
exit 1 ;;
esac
# Make the initialization of official_package_location after define the architecture correctly
official_package_location="https://github.com/zen-browser/desktop/releases/latest/download/zen.linux-$os_arch.tar.xz"
echo "Downloading the latest package"
curl -L --progress-bar -o $tar_location $official_package_location
...
Three changes was made:
I think this make the script a little bit smaller and better. I add the full script. |
That's what I originally did. But then scraped it off, thinking that all variables being at the top makes it easier for others to make changes, if required, since you wouldn't need to check through the entire script to find the variable declaration. I can change the code, but what do you think about this? |
I made another alternative:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has the pros of the above mentioned reasons that you specified, while handling the cons that I mentioned to some extent.
#!/bin/bash
set -euo pipefail
# Variables
...
official_package_location="" # Placeholder for download URL, to be set later
...
# Handle architecture detection and set the correct download URL
case "$os_arch" in
x86_64)
echo "64-bit (Intel/AMD) architecture identified!"
;;
aarch64|arm64)
echo "64-bit ARM architecture identified!"
os_arch="aarch64"
;;
*)
echo "Zen does not support this architecture: $os_arch"
exit 1
;;
esac
# Set the official package download URL after architecture is set
official_package_location="https://github.com/zen-browser/desktop/releases/latest/download/zen.linux-$os_arch.tar.xz"
# Rest of the script
...
I think this is the midway between both the solutions. What do you think?
I like it |
Great! We'll proceed with that approach then... |
6c0bd34
to
6e2f418
Compare
The script will fail on non-linux systems to avoid accidental execution on unsupported platforms
@mauro-balades do you see any bug? |
Changes