From ee170532de2ceee71aeb15ef2120c459f2b7d365 Mon Sep 17 00:00:00 2001 From: "Mr. Pennyworth" Date: Sat, 13 Jul 2024 06:57:59 -0500 Subject: [PATCH] Add installation script Also fix a typo in a JSON snippet in the README --- README.md | 10 +++++++++- install.sh | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 install.sh diff --git a/README.md b/README.md index 8bc3b2f..58d1d6d 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,14 @@ Check out the [toy example](#toy-example) for a quick walk-through. - Workflows should be able to opt out of the extra pane ## Installation + +### Using a Script +Run the following command in the terminal: +```shell +curl -sL https://raw.githubusercontent.com/mr-pennyworth/alfred-extra-pane/main/install.sh | sh +``` + +### Manual Installation - [Download](https://github.com/mr-pennyworth/alfred-extra-pane/releases/latest/) and extract `AlfredExtraPane.app.zip`. - Move the extracted `AlfredExtraPane.app` to `/Applications`. @@ -259,7 +267,7 @@ Add the `customCSSFilename` key to the JSON config: ```json [{ "alignment" : {"vertical" : {"placement" : "bottom", "height" : 600}}, - "customUserAgent": "Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Mobile Safari/537.36" + "customUserAgent": "Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Mobile Safari/537.36", "customCSSFilename": "style.css" }] ``` diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..7150c1c --- /dev/null +++ b/install.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +# Exit immediately if a command exits with a non-zero status. +set -e + +# Print commands and their arguments as they are executed. +set -x + +REPO="https://github.com/mr-pennyworth/alfred-extra-pane" +APP_NAME="AlfredExtraPane.app" +LATEST_RELEASE_URL="$REPO/releases/latest/download/$APP_NAME.zip" +TEMP_DIR="/tmp/alfred-extra-pane" +APP_ZIP="$TEMP_DIR/$APP_NAME.zip" +APP_PATH="/Applications/$APP_NAME" + + +mkdir -p $TEMP_DIR + +echo "Downloading the latest release..." +curl -L $LATEST_RELEASE_URL -o $APP_ZIP + +echo "Extracting the app..." +unzip -q $APP_ZIP -d $TEMP_DIR + +echo "Moving the app to /Applications..." +mv "$TEMP_DIR/$APP_NAME" /Applications/ + +echo "Checking and removing the quarantine attribute if it exists..." +if xattr -p com.apple.quarantine $APP_PATH > /dev/null 2>&1; then + xattr -d com.apple.quarantine $APP_PATH +fi + +echo "Cleaning up..." +rm -rf $TEMP_DIR + +echo "Installation complete." +open /Applications