Ora / install.sh
umer-wasim's picture
Ora 0.5.0: the plan app (Cloudflare); Ora 0.4.3 kept in previous/0.4
ea5a1e6 verified
Raw History Blame Contribute Delete
6.1 kB
#!/bin/bash
# Ora installer for macOS and Linux:
# curl -fsSL https://devseis-ora.static.hf.space/install.sh | bash
# Downloads the current Ora release from Hugging Face (Devseis/ora-releases, folder releases/), checks its SHA-256 against the
# published SHA256SUMS, installs it and opens it. A file fetched with curl is not marked "downloaded from the internet",
# so macOS does not ask you to allow Ora in System Settings. Uninstall: ... | bash -s -- --uninstall [--purge]
# The previous version (Ora 0.4, the video app): https://devseis-ora.static.hf.space/previous/0.4/install.sh
#
# macOS: Ora.app goes to /Applications (or ~/Applications if you cannot write there). No password is needed.
# Linux: the .deb on Debian/Ubuntu (sudo asks for your password), otherwise the AppImage in ~/Applications.
set -euo pipefail
RELEASES="${ORA_RELEASES:-https://huggingface.co/datasets/Devseis/ora-releases/resolve/main/releases}" # ORA_RELEASES: testing only
UNINSTALL=0; PURGE=0
for a in "$@"; do case "$a" in --uninstall) UNINSTALL=1 ;; --purge) PURGE=1 ;; esac; done
bold() { printf '\033[1m%s\033[0m\n' "$*"; }
step() { printf '\033[1;31m›\033[0m %s\n' "$*"; }
fail() { printf '\033[1;31mOra install stopped:\033[0m %s\n' "$*" >&2; exit 1; }
need() { command -v "$1" >/dev/null 2>&1 || fail "the command '$1' is needed but not found."; }
SUDO=sudo; [ "$(id -u)" -eq 0 ] && SUDO=""
OS=$(uname -s)
case "$OS" in Darwin|Linux) ;; *) fail "this installer is for macOS and Linux. On Windows use: irm https://devseis-ora.static.hf.space/install.ps1 | iex" ;; esac
# --- uninstall ---------------------------------------------------------------------------------------------------
if [ "$UNINSTALL" -eq 1 ]; then
bold "Removing Ora"
pkill -f "Ora.app/Contents/MacOS/Ora" 2>/dev/null || true
pkill -f "/opt/Ora/ora" 2>/dev/null || true
for app in /Applications/Ora.app "$HOME/Applications/Ora.app"; do [ -d "$app" ] && rm -rf "$app" && step "removed $app"; done
[ -f "$HOME/Applications/Ora.AppImage" ] && rm -f "$HOME/Applications/Ora.AppImage" "$HOME/.local/share/applications/ora.desktop" && step "removed the Ora AppImage"
if [ "$OS" = Linux ] && dpkg -s devseis-ora >/dev/null 2>&1; then step "removing the Ora package (sudo asks for your password)"; $SUDO apt-get remove -y devseis-ora >/dev/null; fi
if [ "$PURGE" -eq 1 ]; then
for d in "$HOME/Library/Application Support/Ora" "${XDG_CONFIG_HOME:-$HOME/.config}/Ora"; do [ -d "$d" ] && rm -rf "$d" && step "removed the plan, pictures and settings in $d"; done
else
echo "Your plan, pictures and settings were kept. To remove them too: ... | bash -s -- --uninstall --purge"
fi
echo "Your files in Pictures/Ora and Documents/Ora were not touched."
exit 0
fi
need curl
bold "Installing Ora — your marketing plan, step by step, with AI help"
TMP=$(mktemp -d); trap 'rm -rf "$TMP"' EXIT
step "finding the current version"
curl -fsSL "$RELEASES/SHA256SUMS" -o "$TMP/SHA256SUMS" || fail "could not reach Hugging Face. Check the internet connection."
VERSION=$(curl -fsSL "$RELEASES/latest.json" | sed -n 's/.*"version": *"\([0-9.]*\)".*/\1/p' | head -1)
[ -n "$VERSION" ] || fail "could not read the current version."
pick() { awk -v f="$1" '$2 == f { print $1 }' "$TMP/SHA256SUMS"; }
fetch() { # file -> downloads it to $TMP and checks the SHA-256 against SHA256SUMS
local file=$1 want got
want=$(pick "$file"); [ -n "$want" ] || fail "$file is not in SHA256SUMS."
step "downloading $file"
curl -fL --progress-bar "$RELEASES/$file" -o "$TMP/$file" || fail "the download failed."
if command -v shasum >/dev/null 2>&1; then got=$(shasum -a 256 "$TMP/$file" | cut -d' ' -f1); else got=$(sha256sum "$TMP/$file" | cut -d' ' -f1); fi
[ "$got" = "$want" ] || fail "the download does not match the published checksum (expected $want, got $got). Nothing was installed."
step "checksum OK ($want)"
}
if [ "$OS" = Darwin ]; then
FILE="Ora-$VERSION-mac-universal.zip"
fetch "$FILE"
ditto -x -k "$TMP/$FILE" "$TMP/x" || fail "could not unpack Ora."
APP="$TMP/x/Ora/Ora.app"; [ -d "$APP" ] || APP="$TMP/x/Ora.app"; [ -d "$APP" ] || fail "Ora.app was not found in the download."
DEST=/Applications; [ -w "$DEST" ] || { DEST="$HOME/Applications"; mkdir -p "$DEST"; }
pkill -f "Ora.app/Contents/MacOS/Ora" 2>/dev/null && sleep 1 || true
rm -rf "$DEST/Ora.app"
ditto "$APP" "$DEST/Ora.app" || fail "could not copy Ora to $DEST."
xattr -dr com.apple.quarantine "$DEST/Ora.app" 2>/dev/null || true
step "installed Ora $VERSION in $DEST"
open "$DEST/Ora.app"
bold "Done. Ora is open. Next time, open it from $DEST or Launchpad."
else
if command -v apt-get >/dev/null 2>&1 && command -v dpkg >/dev/null 2>&1 && [ "$(uname -m)" = x86_64 ]; then
FILE="Ora-$VERSION-linux-x86_64.deb"
fetch "$FILE"
step "installing the package (sudo asks for your password)"
$SUDO apt-get install -y "$TMP/$FILE" >/dev/null || fail "apt could not install Ora."
step "installed Ora $VERSION"
(nohup /opt/Ora/ora >/dev/null 2>&1 &) || true
bold "Done. Ora is starting. Next time, open Ora from your applications menu."
elif [ "$(uname -m)" = x86_64 ]; then
FILE="Ora-$VERSION-linux-x86_64.AppImage"
fetch "$FILE"
mkdir -p "$HOME/Applications" "$HOME/.local/share/applications"
install -m 755 "$TMP/$FILE" "$HOME/Applications/Ora.AppImage"
printf '[Desktop Entry]\nName=Ora\nComment=Your marketing plan, with AI help\nExec=%s\nTerminal=false\nType=Application\nCategories=Office;\n' "$HOME/Applications/Ora.AppImage" > "$HOME/.local/share/applications/ora.desktop"
step "installed Ora $VERSION in ~/Applications/Ora.AppImage"
(nohup "$HOME/Applications/Ora.AppImage" >/dev/null 2>&1 &) || true
bold "Done. Ora is starting. If it does not open, install FUSE (e.g. sudo dnf install fuse-libs) and run ~/Applications/Ora.AppImage."
else
fail "Ora for Linux needs a 64-bit Intel/AMD (x86_64) computer."
fi
fi