From 695221de0d02f761ac85c37cc0d921e8d8bbe47f Mon Sep 17 00:00:00 2001 From: Quinta <112334784+Quinta0@users.noreply.github.com> Date: Sun, 9 Jun 2024 01:23:36 +0200 Subject: [PATCH] Update install_obsidian.sh --- install_obsidian.sh | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/install_obsidian.sh b/install_obsidian.sh index 10077ea..a1b40d0 100644 --- a/install_obsidian.sh +++ b/install_obsidian.sh @@ -1,6 +1,7 @@ #!/bin/bash install_obsidian_linux() { + echo "Installing Obsidian for Linux..." sudo apt update sudo apt install -y wget jq @@ -13,6 +14,7 @@ install_obsidian_linux() { } install_obsidian_macos() { + echo "Installing Obsidian for macOS..." which -s brew if [[ $? != 0 ]] ; then /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" @@ -30,16 +32,19 @@ install_obsidian_macos() { } install_obsidian_windows() { + echo "Installing Obsidian for Windows..." choco -v if [[ $? != 0 ]] ; then @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" fi choco install -y wget jq + echo "Downloading Obsidian installer..." wget https://github.com/obsidianmd/obsidian-releases/releases/download/v1.6.3/Obsidian.1.6.3.exe -O ObsidianInstaller.exe # Check if the installer was downloaded if [ -f "ObsidianInstaller.exe" ]; then + echo "Running Obsidian installer..." start /wait ObsidianInstaller.exe /S # Check if Obsidian was installed and create a symbolic link for testing @@ -56,6 +61,7 @@ install_obsidian_windows() { } install_plugins() { + echo "Installing plugins..." if [[ "$OSTYPE" == "linux-gnu"* ]]; then pkill Obsidian elif [[ "$OSTYPE" == "darwin"* ]]; then @@ -89,11 +95,18 @@ install_plugins() { echo "Plugins installed successfully!" } -case "$(uname -s)" in - Linux*) install_obsidian_linux ;; - Darwin*) install_obsidian_macos ;; - CYGWIN*|MINGW32*|MSYS*|MINGW*) install_obsidian_windows ;; - *) echo "Unknown OS" ;; +echo "Please select your operating system:" +echo "L) Linux" +echo "M) macOS" +echo "W) Windows" + +read -p "Enter your choice: " os_choice + +case "$os_choice" in + [Ll]) install_obsidian_linux ;; + [Mm]) install_obsidian_macos ;; + [Ww]) install_obsidian_windows ;; + *) echo "Invalid choice. Exiting." ;; esac install_plugins