From 95c1c55f2281b24832b57bbaf3d822076bba8d92 Mon Sep 17 00:00:00 2001
From: Julian Ospald
Date: Thu, 25 Feb 2021 13:32:46 +0100
Subject: [PATCH] Fix copy button for apple silicon
---
www/ghcup.js | 12 +++++++++++-
www/index.html | 8 ++++----
2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/www/ghcup.js b/www/ghcup.js
index 77dd6d4..39ceb37 100644
--- a/www/ghcup.js
+++ b/www/ghcup.js
@@ -149,7 +149,17 @@ function fill_in_bug_report_values() {
}
function copyToClipboard() {
- const text = document.getElementsByClassName("ghcup-command").item(0).innerText;
+ const text = document.getElementById("ghcup-command-normal").innerText;
+ const el = document.createElement('textarea');
+ el.value = text;
+ document.body.appendChild(el);
+ el.select();
+ document.execCommand('copy');
+ document.body.removeChild(el);
+}
+
+function copyToClipboardSilicon() {
+ const text = document.getElementById("ghcup-command-silicon").innerText;
const el = document.createElement('textarea');
el.value = text;
document.body.appendChild(el);
diff --git a/www/index.html b/www/index.html
index d21d2ad..87b9445 100644
--- a/www/index.html
+++ b/www/index.html
@@ -33,9 +33,9 @@
@@ -108,7 +108,7 @@
in your terminal (as a user other than root), then follow the onscreen instructions.
For macOS on Apple Silicon, run this instead:
-
+
If you don't like curl | sh, see other installation methods.
@@ -155,7 +155,7 @@
in your terminal (as a user other than root), then follow the onscreen instructions.
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
For macOS on Apple Silicon, run this instead:
-
+
If you don't like curl | sh, see other installation methods.