#!/bin/sh # Installs Vagalupa for the current user, without root: # # curl -fsSL https://vagalupa.com.br/install.sh | sh # curl -fsSL https://vagalupa.com.br/install.sh | sh -s -- --uninstall # # On Linux it downloads the latest AppImage, checks it against the release's # SHA256SUMS, and puts it in ~/.local/bin/vagalupa with an app menu entry # and icon. On macOS it downloads the latest universal zip, checks SHA256SUMS, # and installs Vagalupa.app into /Applications (if writable) or ~/Applications. # Running it again installs the latest version; your user data is never touched. # # Linux details: versions of this script up to 1.2.1 named the menu entry and # icons job-finder: those files are removed, so the app menu shows one Vagalupa. # The package file is vagalupa--x86_64.AppImage (job-finder-… up to # 1.2.1), and the names inside the AppImage are still job-finder; both are read. # When WebKitGTK 4.1 or FUSE is missing, it prints the command that installs it # on your distribution. # # VAGALUPA_DOWNLOADS overrides where the packages come from (for testing). # VAGALUPA_APPS_DIR overrides the macOS install directory (for testing). set -eu APP=vagalupa APP_BUNDLE=Vagalupa.app LEGACY=job-finder DATA_NAME=job-finder DOWNLOADS="${VAGALUPA_DOWNLOADS:-https://vagalupa.com.br/downloads}" DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" BIN_DIR="$HOME/.local/bin" BIN="$BIN_DIR/$APP" DESKTOP="$DATA_HOME/applications/$APP.desktop" ICONS="$DATA_HOME/icons/hicolor" LEGACY_DESKTOP="$DATA_HOME/applications/$LEGACY.desktop" case "${LC_ALL:-${LC_MESSAGES:-${LANG:-}}}" in pt*) PT=1 ;; *) PT= ;; esac # say prints the Portuguese or the English line. say() { if [ -n "$PT" ]; then printf '%s\n' "$1"; else printf '%s\n' "$2"; fi; } step() { printf '\033[1;34m==>\033[0m '; say "$@"; } warn() { printf '\033[1;33m!\033[0m ' >&2; say "$@" >&2; } die() { printf '\033[1;31mx\033[0m ' >&2 say "$@" >&2 exit 1 } # While the AppImage downloads in a terminal, a magnifying glass (the # "lupa" in Vagalupa) moves over lines of job titles. The titles under the # glass are sharp; away from it they break up into an ordered dither. The # awk program draws one frame: f is the frame number, focus (0 to 8) clears # the dither when the download is done, and the last line is curl's # progress, read from the file prog. Piped, with NO_COLOR or on a dumb # terminal, the plain progress bar shows instead. LENS_AWK=' function rgb(r, g, b, bg) { if (tc) return sprintf("\033[%d;2;%d;%d;%dm", bg ? 48 : 38, r, g, b) return sprintf("\033[%d;5;%dm", bg ? 48 : 38, 16 + 36 * int(r / 51 + 0.5) + 6 * int(g / 51 + 0.5) + int(b / 51 + 0.5)) } function mix(t) { t = t < 0 ? 0 : t > 1 ? 1 : t return rgb(61 + 77 * t, 91 + t, 217 + 29 * t) } # No cos, sqrt or ^: some awks are built without maths. function inside(x, y) { return (x - cx) * (x - cx) / (rx * rx) + (y - cy) * (y - cy) / (ry * ry) < 1 } function root(q, r, i) { r = q > 1 ? q : 1 for (i = 0; i < 8; i++) r = (r + q / r) / 2 return r } function put(style, ch) { if (style != cur) { out = out "\033[0m" style; cur = style } out = out ch } BEGIN { if (pt) roles = "Analista de Dados|Designer de Produto|Engenheira de Software|Product Manager|Tech Lead|Desenvolvedor Backend|Cientista de Dados|Gerente de Projetos|Analista de Marketing|Engenheiro de Dados|Designer UX|Recrutadora|SRE|Analista Financeiro|Desenvolvedora Frontend|Analista de QA|DevOps|Customer Success" else roles = "Data Analyst|Product Designer|Software Engineer|Product Manager|Tech Lead|Backend Developer|Data Scientist|Project Manager|Marketing Analyst|Data Engineer|UX Designer|Recruiter|SRE|Financial Analyst|Frontend Developer|QA Analyst|DevOps Engineer|Customer Success" n = split(roles, R, "|") split("0 8 2 10 12 4 14 6 3 11 1 9 15 7 13 5", B, " ") if (uni) { near = "\342\226\222"; far = "\342\226\221"; solid = "\342\226\210"; top = "\342\226\204"; bottom = "\342\226\200"; empty = "\342\226\221" } else { near = ":"; far = "."; solid = "#"; top = "#"; bottom = "#"; empty = "-" } H = 9; rx = 9.5; ry = 3.4; cy = 3 # Back and forth, easing at each end. p = f % 100 / 50; p = p > 1 ? 2 - p : p cx = rx + 1 + (w - 2 * rx - 16) * p * p * (3 - 2 * p) glass = "\033[1m" rgb(244, 241, 234) rgb(30, 36, 78, 1) dim = rgb(128, 128, 142) shade = rgb(96, 98, 120) for (y = 0; y < H; y++) { s = "" for (k = 0; length(s) < 2 * w; k++) s = s R[1 + (y * 7 + k * 5) % n] " " len = length(s) off = int(f * (0.25 + 0.2 * (y % 3))) out = ""; cur = "" for (x = 0; x < w; x++) { c = substr(s, 1 + (x + off) % len, 1) dx = (x - cx) / rx; dy = (y - cy) / ry d = root(dx * dx + dy * dy) k = y - cy - 2 hx = int(cx + rx * 0.7 + 2 * k - 1) if (k >= 1 && k <= 3 && (x >= hx && x <= hx + 2)) { put(mix(0.6 + k / 8), solid); continue } if (inside(x, y)) { # The rim is the edge of the glass: half blocks on the top # and bottom rows keep it one line thin. up = inside(x, y - 1); down = inside(x, y + 1) if (up && down && inside(x - 1, y) && inside(x + 1, y)) put(glass, c) else put(mix((x - cx + rx) / (2 * rx)), !up && down ? top : up && !down ? bottom : solid) continue } if (c == " ") { put("", " "); continue } blur = (d - 1) / 1.5 * (8 - focus) / 8 if ((B[1 + (y % 4) * 4 + (x % 4)] + 0.5) / 16 > blur) put(dim, c) else put(shade, blur < 0.6 ? near : far) } line[y] = out } RS = "\r"; pct = 0 while ((getline rec < prog) > 0) if (match(rec, /[0-9]+(\.[0-9])?%/)) pct = substr(rec, RSTART, RLENGTH - 1) + 0 if (focus > 0) pct = 100 bw = 24; fill = int(pct / 100 * bw + 0.5); out = ""; cur = "" for (i = 0; i < bw; i++) if (i < fill) put(mix(i / bw), solid); else put(shade, empty) if (f > 0 || focus > 0) printf "\033[%dA", H + 1 for (y = 0; y < H; y++) printf "\r\033[2K%s\033[0m\n", line[y] printf "\r\033[2K\033[1;34m==>\033[0m %s %s\033[0m %3d%%\n", label, out, pct }' # lens_setup turns the animation on when it can draw: a colour terminal # at least 44 columns wide on standard error, where curl's bar would go. lens_setup() { LENS= [ -t 2 ] && [ -z "${NO_COLOR:-}" ] && [ "${TERM:-dumb}" != dumb ] || return 0 cols=$(stty size <&2 2>/dev/null | cut -d' ' -f2) [ -n "$cols" ] || cols=$(stty size 2>/dev/null /dev/null || echo 0) [ "$cols" -ge 44 ] 2>/dev/null || return 0 LENS_W=$((cols - 1)) [ "$LENS_W" -le 76 ] || LENS_W=76 case "${COLORTERM:-}" in truecolor | 24bit) LENS_TC=1 ;; *) LENS_TC= ;; esac case "${LC_ALL:-${LC_CTYPE:-${LANG:-}}}" in *[Uu][Tt][Ff]-8* | *[Uu][Tt][Ff]8*) LENS_UNI=1 ;; *) LENS_UNI= ;; esac LENS=1 lens 0 0 "" >/dev/null 2>&1 || LENS= } # lens draws frame $1 with focus $2 over the progress line $3. lens() { awk -v f="$1" -v focus="$2" -v label="$3" -v w="$LENS_W" -v pt="$PT" -v uni="$LENS_UNI" \ -v tc="$LENS_TC" -v prog="$tmp/progress" "$LENS_AWK" } # download fetches $DOWNLOADS/$1 to $2 and writes the address it was # redirected to in $tmp/url. download() { platform="$1" out="$2" if [ -z "$LENS" ]; then curl -fL --progress-bar -o "$out" -w '%{url_effective}' "$DOWNLOADS/$platform" >"$tmp/url" return fi label=$(say "Baixando o Vagalupa" "Downloading Vagalupa") curl -fL --progress-bar -o "$out" -w '%{url_effective}' "$DOWNLOADS/$platform" \ >"$tmp/url" 2>"$tmp/progress" & dl_pid=$! printf '\033[?25l' >&2 f=0 while kill -0 "$dl_pid" 2>/dev/null; do lens "$f" 0 "$label" >&2 f=$((f + 1)) sleep 0.08 2>/dev/null || sleep 1 done ok=1 wait "$dl_pid" || ok= dl_pid= if [ -n "$ok" ]; then for focus in 1 2 3 4 5 6 7 8; do lens "$f" "$focus" "$label" >&2 sleep 0.05 2>/dev/null || true done fi printf '\033[?25h' >&2 [ -n "$ok" ] } # distro is the first of ID and ID_LIKE in /etc/os-release this script knows. distro() { ids=$( . /etc/os-release 2>/dev/null || true echo "${ID:-} ${ID_LIKE:-}" ) for id in $ids; do case "$id" in arch | manjaro | endeavouros) echo arch && return ;; debian | ubuntu) echo debian && return ;; fedora | rhel | centos) echo fedora && return ;; opensuse* | suse | sles) echo suse && return ;; esac done echo other } have_lib() { for lc in ldconfig /sbin/ldconfig /usr/sbin/ldconfig; do if command -v "$lc" >/dev/null 2>&1 && "$lc" -p 2>/dev/null | grep -q "$1"; then return 0 fi done for dir in /usr/lib /usr/lib64 /usr/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu /usr/local/lib; do [ -e "$dir/$1" ] && return 0 done return 1 } have_fuse() { [ -e /dev/fuse ] && { command -v fusermount3 >/dev/null 2>&1 || command -v fusermount >/dev/null 2>&1; } } refresh_caches() { command -v update-desktop-database >/dev/null 2>&1 && update-desktop-database -q "$DATA_HOME/applications" 2>/dev/null || true if command -v gtk-update-icon-cache >/dev/null 2>&1 && [ -f "$ICONS/index.theme" ]; then gtk-update-icon-cache -q -t "$ICONS" 2>/dev/null || true fi } uninstall_linux() { removed= for f in "$BIN" "$DESKTOP" "$ICONS/256x256/apps/$APP.png" "$ICONS/512x512/apps/$APP.png" \ "$LEGACY_DESKTOP" "$ICONS/256x256/apps/$LEGACY.png" "$ICONS/512x512/apps/$LEGACY.png"; do if [ -e "$f" ] || [ -L "$f" ]; then rm -f -- "$f" removed=1 fi done refresh_caches if [ -n "$removed" ]; then say "Vagalupa foi removido. Seus dados continuam em ${XDG_CONFIG_HOME:-$HOME/.config}/$DATA_NAME." \ "Vagalupa was removed. Your data is still in ${XDG_CONFIG_HOME:-$HOME/.config}/$DATA_NAME." else say "O Vagalupa não está instalado." "Vagalupa is not installed." fi } remove_macos_bundle() { bundle="$1" [ -e "$bundle" ] || [ -L "$bundle" ] || return 0 parent=${bundle%/*} [ -n "$parent" ] || parent=/ if [ ! -w "$parent" ] || ! rm -rf -- "$bundle" 2>/dev/null; then warn "Não deu para remover $bundle (sem permissão de escrita)." \ "Could not remove $bundle (not writable)." uninstall_failed=1 return 0 fi uninstall_removed=1 } uninstall_macos() { uninstall_removed= uninstall_failed= if [ -n "${VAGALUPA_APPS_DIR:-}" ]; then apps_dir=${VAGALUPA_APPS_DIR%/} [ -n "$apps_dir" ] || apps_dir=/ remove_macos_bundle "$apps_dir/$APP_BUNDLE" else remove_macos_bundle "/Applications/$APP_BUNDLE" remove_macos_bundle "$HOME/Applications/$APP_BUNDLE" fi if [ -n "$uninstall_removed" ]; then say "Vagalupa foi removido. Seus dados continuam em $HOME/Library/Application Support/$DATA_NAME." \ "Vagalupa was removed. Your data is still in $HOME/Library/Application Support/$DATA_NAME." elif [ -z "$uninstall_failed" ]; then say "O Vagalupa não está instalado." "Vagalupa is not installed." fi [ -z "$uninstall_failed" ] } uninstall() { case "$(uname -s)" in Linux) uninstall_linux ;; Darwin) uninstall_macos ;; *) die "Este instalador é para Linux e macOS. Baixe para o seu sistema em https://vagalupa.com.br" \ "This installer is for Linux and macOS. Download for your system at https://vagalupa.com.br" ;; esac } # cleanup stops a download still running, shows the cursor again and # removes the temporary folder. cleanup() { if [ -n "${dl_pid:-}" ]; then kill "$dl_pid" 2>/dev/null || true; fi if [ -n "${LENS:-}" ]; then printf '\033[0m\033[?25h' >&2; fi if [ -n "${tmp:-}" ]; then rm -rf "$tmp"; fi } setup_sha() { if command -v sha256sum >/dev/null 2>&1; then sha() { sha256sum "$1" | cut -d' ' -f1; } elif command -v shasum >/dev/null 2>&1; then sha() { shasum -a 256 "$1" | cut -d' ' -f1; } else die "Instale o sha256sum (coreutils) e rode de novo." "Install sha256sum (coreutils) and run this again." fi } init_tmp() { # Under the home folder, not /tmp: on Linux the AppImage runs from here # to unpack its icon, and /tmp may be mounted noexec on some systems. cache="${XDG_CACHE_HOME:-$HOME/.cache}" mkdir -p "$cache" tmp=$(mktemp -d "$cache/$APP-install.XXXXXX") trap cleanup EXIT trap 'exit 130' INT trap 'exit 143' TERM } download_and_verify() { platform="$1" out="$2" lens_setup [ -n "$LENS" ] || step "Baixando o Vagalupa" "Downloading Vagalupa" download "$platform" "$out" || die "Não deu para baixar. Tente de novo em alguns minutos." "The download failed. Try again in a few minutes." url=$(cat "$tmp/url") DOWNLOAD_NAME=${url##*/} curl -fsSL -o "$tmp/SHA256SUMS" "${url%/*}/SHA256SUMS" || die "Não deu para baixar as somas de verificação." "Could not download the checksums." want=$(awk -v n="$DOWNLOAD_NAME" '{ f = $2; sub(/^\*/, "", f) } f == n { print $1; exit }' "$tmp/SHA256SUMS") [ -n "$want" ] && [ "$(sha "$out")" = "$want" ] || die "O arquivo baixado não confere com a soma da versão. Nada foi instalado." \ "The download does not match the release's checksum. Nothing was installed." } install_linux() { [ "$(uname -m)" = x86_64 ] || die "O Vagalupa para Linux é só x86_64 (este computador é $(uname -m))." \ "Vagalupa for Linux is x86_64 only (this computer is $(uname -m))." glibc=$(ldd --version 2>&1 | head -n1 || true) case "$glibc" in *musl*) die "O Vagalupa precisa da glibc; este sistema usa musl." "Vagalupa needs glibc; this system uses musl." ;; esac v=$(printf '%s\n' "$glibc" | grep -o '[0-9]\+\.[0-9]\+$' || true) if [ -n "$v" ] && [ "${v%%.*}" -eq 2 ] && [ "${v#*.}" -lt 34 ]; then die "O Vagalupa precisa da glibc 2.34 ou mais nova (este sistema tem $v)." \ "Vagalupa needs glibc 2.34 or newer (this system has $v)." fi command -v curl >/dev/null 2>&1 || die "Instale o curl e rode de novo." "Install curl and run this again." setup_sha init_tmp download_and_verify "latest/linux" "$tmp/$APP.AppImage" version=${DOWNLOAD_NAME#"$APP"-} version=${version#"$LEGACY"-} version=${version%-x86_64.AppImage} step "Instalando a versão $version" "Installing version $version" chmod 755 "$tmp/$APP.AppImage" # The menu entry and icon come from the AppImage itself (unpacking needs no FUSE). # The entry's name inside the AppImage is job-finder today; asking for a # name it lacks unpacks nothing. (cd "$tmp" && { "./$APP.AppImage" --appimage-extract "$LEGACY.desktop" >/dev/null 2>&1 || true; } && { "./$APP.AppImage" --appimage-extract "$APP.desktop" >/dev/null 2>&1 || true; } && "./$APP.AppImage" --appimage-extract "usr/share/icons/*" >/dev/null 2>&1) || die "O AppImage baixado não abriu. Nada foi instalado." "The downloaded AppImage would not open. Nothing was installed." entry= for n in "$LEGACY" "$APP"; do [ -f "$tmp/squashfs-root/$n.desktop" ] && entry="$tmp/squashfs-root/$n.desktop" && break done [ -n "$entry" ] || die "O AppImage baixado não abriu. Nada foi instalado." "The downloaded AppImage would not open. Nothing was installed." mkdir -p "$BIN_DIR" "$DATA_HOME/applications" # Replace it in one step, also while the app runs. cp "$tmp/$APP.AppImage" "$BIN.new" mv -f "$BIN.new" "$BIN" for size in 256x256 512x512; do for n in "$LEGACY" "$APP"; do icon="$tmp/squashfs-root/usr/share/icons/hicolor/$size/apps/$n.png" if [ -f "$icon" ]; then mkdir -p "$ICONS/$size/apps" cp "$icon" "$ICONS/$size/apps/$APP.png" break fi done done # An absolute Exec: ~/.local/bin is not on every desktop session's PATH. # Without FUSE the AppImage unpacks itself at each start instead. # The path is quoted for a home folder with spaces; a few characters # would need escaping rules no launcher agrees on, so those skip the entry. case "$BIN" in *'"'* | *'`'* | *'$'* | *'\'*) warn "O nome da sua pasta pessoal não cabe num atalho do menu; abra o app por $BIN." \ "Your home folder's name can't go in a menu entry; open the app with $BIN." ;; *) exec_line="Exec=\"$(printf '%s' "$BIN" | sed 's/%/%%/g')\"" have_fuse || exec_line="Exec=env APPIMAGE_EXTRACT_AND_RUN=1 \"$(printf '%s' "$BIN" | sed 's/%/%%/g')\"" # The icon is installed under this script's name for it, whatever # the AppImage calls it. { grep -v -e '^Exec=' -e '^Icon=' "$entry" printf 'Icon=%s\n' "$APP" printf '%s\n' "$exec_line" } >"$DESKTOP.new" chmod 644 "$DESKTOP.new" mv -f "$DESKTOP.new" "$DESKTOP" # The entry and icons earlier versions installed, now that the new # entry is in place: the app menu shows one Vagalupa, never none. rm -f -- "$LEGACY_DESKTOP" "$ICONS/256x256/apps/$LEGACY.png" "$ICONS/512x512/apps/$LEGACY.png" ;; esac refresh_caches d=$(distro) missing= if ! have_lib libwebkit2gtk-4.1.so.0; then case "$d" in arch) missing="webkit2gtk-4.1" ;; debian) missing="libwebkit2gtk-4.1-0" ;; fedora) missing="webkit2gtk4.1" ;; suse) missing="libwebkit2gtk-4_1-0" ;; *) missing="WebKitGTK 4.1" ;; esac fi if ! have_fuse; then case "$d" in arch | debian | fedora | suse) missing="${missing:+$missing }fuse3" ;; *) missing="${missing:+$missing, }FUSE" ;; esac fi say "" "" say "Vagalupa $version instalado. Abra pelo menu de aplicativos ou rode: $BIN" \ "Vagalupa $version is installed. Open it from your app menu or run: $BIN" case ":$PATH:" in *":$BIN_DIR:"*) ;; *) say "(Para rodar $APP no terminal, adicione $BIN_DIR ao seu PATH.)" \ "(To run $APP in a terminal, add $BIN_DIR to your PATH.)" ;; esac if [ -n "$missing" ]; then say "" "" if have_lib libwebkit2gtk-4.1.so.0; then say "Opcional: com FUSE o app abre mais rápido. Instale e rode este instalador de novo:" \ "Optional: with FUSE the app starts faster. Install it, then run this installer again:" else warn "Falta o WebKitGTK 4.1, sem o qual o app não abre. Instale com:" \ "WebKitGTK 4.1 is missing, and the app won't open without it. Install it with:" fi case "$d" in arch) echo " sudo pacman -S --needed $missing" ;; debian) echo " sudo apt install $missing" ;; fedora) echo " sudo dnf install $missing" ;; suse) echo " sudo zypper install $missing" ;; *) say " o pacote $missing da sua distribuição" " your distribution's $missing package" ;; esac fi } install_macos() { case "$(uname -m)" in arm64 | x86_64) ;; *) die "O Vagalupa para macOS é só arm64 ou x86_64 (este computador é $(uname -m))." \ "Vagalupa for macOS supports arm64 and x86_64 only (this computer is $(uname -m))." ;; esac command -v curl >/dev/null 2>&1 || die "Instale o curl e rode de novo." "Install curl and run this again." if command -v ditto >/dev/null 2>&1; then use_ditto=1 elif command -v unzip >/dev/null 2>&1; then use_ditto= else die "Instale o ditto ou unzip e rode de novo." "Install ditto or unzip and run this again." fi setup_sha init_tmp download_and_verify "latest/macos-zip" "$tmp/$APP.zip" version=${DOWNLOAD_NAME#"$APP"-} version=${version#"$LEGACY"-} version=${version%-macos-universal.zip} version=${version%.zip} step "Instalando a versão $version" "Installing version $version" mkdir -p "$tmp/extract" if [ -n "$use_ditto" ]; then ditto -x -k "$tmp/$APP.zip" "$tmp/extract" >/dev/null 2>&1 || die "O pacote baixado não abriu. Nada foi instalado." \ "The downloaded archive could not be extracted. Nothing was installed." else unzip -q "$tmp/$APP.zip" -d "$tmp/extract" >/dev/null 2>&1 || die "O pacote baixado não abriu. Nada foi instalado." \ "The downloaded archive could not be extracted. Nothing was installed." fi [ -d "$tmp/extract/$APP_BUNDLE" ] || die "O pacote baixado não contém $APP_BUNDLE. Nada foi instalado." \ "The downloaded archive does not contain $APP_BUNDLE. Nothing was installed." if command -v xattr >/dev/null 2>&1; then xattr -dr com.apple.quarantine "$tmp/extract/$APP_BUNDLE" 2>/dev/null || true fi if [ -n "${VAGALUPA_APPS_DIR:-}" ]; then apps_dir=${VAGALUPA_APPS_DIR%/} [ -n "$apps_dir" ] || apps_dir=/ elif [ -d /Applications ] && [ -w /Applications ]; then apps_dir=/Applications else apps_dir="$HOME/Applications" fi mkdir -p "$apps_dir" dest="$apps_dir/$APP_BUNDLE" stage="$apps_dir/.$APP_BUNDLE.new" backup="$apps_dir/.$APP_BUNDLE.old" rm -rf "$stage" "$backup" if [ -n "$use_ditto" ]; then ditto "$tmp/extract/$APP_BUNDLE" "$stage" || { rm -rf "$stage" die "Não deu para instalar em $apps_dir." "Could not install into $apps_dir." } else cp -Rp "$tmp/extract/$APP_BUNDLE" "$stage" || { rm -rf "$stage" die "Não deu para instalar em $apps_dir." "Could not install into $apps_dir." } fi if [ -e "$dest" ] || [ -L "$dest" ]; then mv "$dest" "$backup" || { rm -rf "$stage" die "Não deu para substituir $dest." "Could not replace $dest." } fi if ! mv "$stage" "$dest"; then rm -rf "$stage" if [ -e "$backup" ] || [ -L "$backup" ]; then mv "$backup" "$dest" 2>/dev/null || true fi die "Não deu para instalar em $dest." "Could not install to $dest." fi rm -rf "$backup" if command -v xattr >/dev/null 2>&1; then xattr -dr com.apple.quarantine "$dest" 2>/dev/null || true fi say "" "" say "Vagalupa $version instalado em $dest." "Vagalupa $version is installed at $dest." say "Abra pelo Spotlight, pela pasta Aplicativos ou rode: open -a \"$dest\"" \ "Open it from Spotlight, Applications, or run: open -a \"$dest\"" } install_app() { case "$(uname -s)" in Linux) install_linux ;; Darwin) install_macos ;; *) die "Este instalador é para Linux e macOS. Baixe para o seu sistema em https://vagalupa.com.br" \ "This installer is for Linux and macOS. Download for your system at https://vagalupa.com.br" ;; esac } case "${1:-}" in "") install_app ;; --uninstall | -u) uninstall ;; -h | --help) say "Uso: curl -fsSL https://vagalupa.com.br/install.sh | sh [-s -- --uninstall]" "Usage: curl -fsSL https://vagalupa.com.br/install.sh | sh [-s -- --uninstall]" ;; *) die "Opção desconhecida: $1 (use --uninstall)" "Unknown option: $1 (use --uninstall)" ;; esac