Skip to content

Commit

Permalink
Add installation script
Browse files Browse the repository at this point in the history
Also fix a typo in a JSON snippet in the README
  • Loading branch information
mr-pennyworth committed Jul 13, 2024
1 parent 33f594b commit ee17053
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -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"
}]
```
Expand Down
37 changes: 37 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ee17053

Please sign in to comment.