Repository navigation
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
Β·568 lines (485 loc) Β· 24.1 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
Β·568 lines (485 loc) Β· 24.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
#!/usr/bin/env bash
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# π Obsidian Python Bridge β Interactive Installer
# https://github.com/mathe00/obsidian-plugin-python-bridge
#
# One-liner install (Linux / macOS):
# curl -fsSL https://raw.githubusercontent.com/mathe00/obsidian-plugin-python-bridge/main/install.sh | bash
#
# Or: wget -qO- https://raw.githubusercontent.com/.../install.sh | bash
#
# License: MIT β Same as the project itself.
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
set -euo pipefail
# βββ Color Definitions ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
MAGENTA='\033[0;35m'
CYAN='\033[0;36m'
BOLD='\033[1m'
DIM='\033[2m'
UNDERLINE='\033[4m'
RESET='\033[0m'
# βββ Helper Functions ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
info() { echo -e "${CYAN} βΉ${RESET} $*"; }
success() { echo -e "${GREEN} β${RESET} $*"; }
warn() { echo -e "${YELLOW} β ${RESET} $*"; }
error() { echo -e "${RED} β${RESET} $*"; }
step() { echo -e "\n${BOLD}${BLUE} βΈ Step $1:${RESET} ${BOLD}$2${RESET}"; }
ask() { echo -ne "${MAGENTA} β―${RESET} $* "; }
# Print a separator line
sep() {
echo -e "${DIM} βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ${RESET}"
}
# Check if a command exists
has_cmd() {
command -v "$1" &>/dev/null
}
# Download a file β tries curl then wget
download() {
local url="$1" dest="$2"
if has_cmd curl; then
curl -fsSL "$url" -o "$dest"
elif has_cmd wget; then
wget -qO "$dest" "$url"
else
error "Neither curl nor wget found. Please install one and retry."
exit 1
fi
}
# βββ Banner βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
print_banner() {
echo ""
echo -e "${BOLD}${CYAN} βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ${RESET}"
echo -e "${BOLD}${CYAN} β${RESET} ${BOLD}${CYAN}β${RESET}"
echo -e "${BOLD}${CYAN} β${RESET} ${BOLD}${GREEN}π Obsidian Python Bridge${RESET} β Interactive Installer ${BOLD}${CYAN}β${RESET}"
echo -e "${BOLD}${CYAN} β${RESET} ${BOLD}${CYAN}β${RESET}"
echo -e "${BOLD}${CYAN} β${RESET} ${DIM}Write Obsidian plugins in Python!${RESET} ${BOLD}${CYAN}β${RESET}"
echo -e "${BOLD}${CYAN} β${RESET} ${DIM}https://github.com/mathe00/obsidian-plugin-python-bridge${RESET} ${BOLD}${CYAN}β${RESET}"
echo -e "${BOLD}${CYAN} β${RESET} ${BOLD}${CYAN}β${RESET}"
echo -e "${BOLD}${CYAN} βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ${RESET}"
echo ""
}
# βββ Detect OS ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
detect_os() {
local uname_out
uname_out="$(uname -s)"
case "$uname_out" in
Linux*)
# Check for WSL
if grep -qi microsoft /proc/version 2>/dev/null; then
echo "wsl"
else
echo "linux"
fi
;;
Darwin*) echo "macos" ;;
MINGW*|MSYS*|CYGWIN*) echo "windows-git-bash" ;;
*) echo "unknown: $uname_out" ;;
esac
}
# βββ Find Obsidian Vaults βββββββββββββββββββββββββββββββββββββββββββββββββββββ
find_vaults() {
local candidates=()
local search_dirs=()
# Build list of directories to search
# Home directory (depth 1 β common for single-vault setups)
search_dirs+=("$HOME")
# Standard locations
for d in "$HOME/Obsidian" "$HOME/Documents/Obsidian" "$HOME/Documents" "$HOME/Desktop"; do
[[ -d "$d" ]] && search_dirs+=("$d")
done
# On macOS, also check iCloud Drive path
if [[ "$(detect_os)" == "macos" ]]; then
local icloud="$HOME/Library/Mobile Documents/iCloud~md~obsidian/Documents"
[[ -d "$icloud" ]] && search_dirs+=("$icloud")
fi
# Search for .obsidian directories (max depth 3, limit to 10 results)
for search_dir in "${search_dirs[@]}"; do
while IFS= read -r -d '' obs_dir; do
local vault_path
vault_path="$(dirname "$obs_dir")"
# Skip the .obsidian plugins dir itself and the plugin's own .obsidian
if [[ "$vault_path" == *"/.obsidian/plugins"* ]]; then
continue
fi
# Deduplicate
if [[ " ${candidates[*]} " != *" $vault_path "* ]]; then
candidates+=("$vault_path")
fi
# Safety: stop at 10
(( ${#candidates[@]} >= 10 )) && break 2
done < <(find "$search_dir" -maxdepth 3 -name ".obsidian" -type d -print0 2>/dev/null)
done
printf '%s\n' "${candidates[@]}"
}
# βββ Prompt for Vault Path ββββββββββββββββββββββββββββββββββββββββββββββββββββ
prompt_vault_path() {
local vaults
vaults="$(find_vaults)"
if [[ -n "$vaults" ]]; then
echo -e "\n ${BOLD}Obsidian vault(s) detected on your system:${RESET}\n"
local i=1
local vault_array=()
while IFS= read -r v; do
echo -e " ${BOLD}${CYAN} [$i]${RESET} $v"
vault_array+=("$v")
((i++))
done <<< "$vaults"
echo -e " ${BOLD}${CYAN} [0]${RESET} Enter path manually"
echo ""
ask "Choose a vault (0-${#vault_array[@]}):"
read -r choice
# Validate choice
if [[ "$choice" =~ ^[0-9]+$ ]] && (( choice >= 1 && choice <= ${#vault_array[@]} )); then
SELECTED_VAULT="${vault_array[$((choice-1))]}"
elif [[ "$choice" == "0" ]]; then
ask "Enter the full path to your Obsidian vault:"
read -r SELECTED_VAULT
else
error "Invalid choice."
exit 1
fi
else
echo -e "\n ${DIM}No Obsidian vaults auto-detected.${RESET}"
ask "Enter the full path to your Obsidian vault:"
read -r SELECTED_VAULT
fi
# Validate the path
if [[ ! -d "$SELECTED_VAULT" ]]; then
error "Directory does not exist: $SELECTED_VAULT"
ask "Create it? (y/N):"
read -r create_choice
if [[ "$create_choice" =~ ^[Yy]$ ]]; then
mkdir -p "$SELECTED_VAULT"
success "Created directory: $SELECTED_VAULT"
else
error "Cannot continue without a valid vault directory."
exit 1
fi
fi
# Verify it looks like an Obsidian vault (has or can have .obsidian dir)
if [[ ! -d "$SELECTED_VAULT/.obsidian" ]]; then
warn "No .obsidian directory found at $SELECTED_VAULT"
warn "This may not be a valid Obsidian vault."
ask "Continue anyway? (y/N):"
read -r cont_choice
if [[ ! "$cont_choice" =~ ^[Yy]$ ]]; then
exit 0
fi
fi
# Expand to absolute path
SELECTED_VAULT="$(cd "$SELECTED_VAULT" && pwd)"
success "Vault path: ${BOLD}$SELECTED_VAULT${RESET}"
}
# βββ Check Prerequisites ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
check_prerequisites() {
local missing=()
# curl or wget
if ! has_cmd curl && ! has_cmd wget; then
missing+=("curl (or wget)")
fi
# unzip (for release zip) or tar (for source tarball)
if ! has_cmd unzip; then
# tar is usually always available on Unix, but check
if ! has_cmd tar; then
missing+=("unzip (or tar)")
fi
fi
# Python 3
local python_cmd=""
if has_cmd python3; then
python_cmd="python3"
elif has_cmd python; then
# Check if it's Python 3
if python --version 2>&1 | grep -q "Python 3"; then
python_cmd="python"
fi
fi
if [[ -z "$python_cmd" ]]; then
missing+=("Python 3")
fi
if [[ ${#missing[@]} -gt 0 ]]; then
error "Missing prerequisites:"
for m in "${missing[@]}"; do
echo -e " ${RED}β’ $m${RESET}"
done
echo ""
info "Install them with your package manager, e.g.:"
echo -e " ${DIM}sudo apt install curl unzip python3 (Debian/Ubuntu)${RESET}"
echo -e " ${DIM}brew install curl unzip python3 (macOS/Homebrew)${RESET}"
echo -e " ${DIM}sudo dnf install curl unzip python3 (Fedora/RHEL)${RESET}"
exit 1
fi
# Store the python command for later use
PYTHON_CMD="$python_cmd"
success "curl/wwget: found"
success "unzip/tar: found"
success "Python: $("$PYTHON_CMD" --version 2>&1 | head -1)"
}
# βββ Get Latest Release Info ββββββββββββββββββββββββββββββββββββββββββββββββββ
get_latest_release() {
info "Fetching latest release info from GitHub..."
local release_json
release_json="$(download "https://api.github.com/repos/mathe00/obsidian-plugin-python-bridge/releases/latest" "$TMPDIR/release.json" 2>/dev/null && cat "$TMPDIR/release.json")"
if [[ -z "$release_json" ]]; then
error "Failed to fetch release info from GitHub."
error "Check your internet connection and try again."
exit 1
fi
# Extract tag name (version)
RELEASE_TAG="$(echo "$release_json" | grep -o '"tag_name":"[^"]*"' | head -1 | sed 's/"tag_name":"//;s/"//')"
if [[ -z "$RELEASE_TAG" ]]; then
error "Could not determine latest release version."
exit 1
fi
# Extract the release ZIP URL (the .zip asset, not the source zipball)
RELEASE_ZIP_URL="$(echo "$release_json" | grep -o '"browser_download_url":"[^"]*obsidian-python-bridge[^"]*\.zip"' | head -1 | sed 's/"browser_download_url":"//;s/"//')"
# Extract individual asset URLs as fallbacks
MAIN_JS_URL="$(echo "$release_json" | grep -o '"browser_download_url":"[^"]*main\.js"' | head -1 | sed 's/"browser_download_url":"//;s/"//')"
MANIFEST_URL="$(echo "$release_json" | grep -o '"browser_download_url":"[^"]*manifest\.json"' | head -1 | sed 's/"browser_download_url":"//;s/"//')"
PYLIB_URL="$(echo "$release_json" | grep -o '"browser_download_url":"[^"]*ObsidianPluginDevPythonToJS\.py"' | head -1 | sed 's/"browser_download_url":"//;s/"//')"
# Source tarball URL (for Python library files that may not be in the release)
SOURCE_TARBALL_URL="https://api.github.com/repos/mathe00/obsidian-plugin-python-bridge/tarball/main"
success "Latest release: ${BOLD}v${RELEASE_TAG}${RESET}"
}
# βββ Download & Install Plugin Files ββββββββββββββββββββββββββββββββββββββββββ
install_plugin_files() {
local plugin_dir="$1"
local version="$2"
info "Downloading Obsidian Python Bridge v${version}..."
# ββ Step A: Download the release ZIP ββ
if [[ -n "$RELEASE_ZIP_URL" ]]; then
info "Downloading release archive..."
download "$RELEASE_ZIP_URL" "$TMPDIR/release.zip"
info "Extracting plugin files (main.js, manifest.json, styles.css)..."
if has_cmd unzip; then
unzip -qo "$TMPDIR/release.zip" -d "$plugin_dir"
else
# Python fallback for extraction
"$PYTHON_CMD" -c "
import zipfile, sys
with zipfile.ZipFile('$TMPDIR/release.zip', 'r') as z:
z.extractall('$plugin_dir')
"
fi
success "Release archive extracted."
else
# Fallback: download individual files
warn "No release ZIP found. Downloading individual files..."
if [[ -n "$MAIN_JS_URL" ]]; then
info " Downloading main.js..."
download "$MAIN_JS_URL" "$plugin_dir/main.js"
else
error " main.js not found in release assets!"
exit 1
fi
if [[ -n "$MANIFEST_URL" ]]; then
info " Downloading manifest.json..."
download "$MANIFEST_URL" "$plugin_dir/manifest.json"
fi
fi
# ββ Step B: Download the Python client library (shim) ββ
if [[ ! -f "$plugin_dir/ObsidianPluginDevPythonToJS.py" ]]; then
if [[ -n "$PYLIB_URL" ]]; then
info "Downloading Python client library (ObsidianPluginDevPythonToJS.py)..."
download "$PYLIB_URL" "$plugin_dir/ObsidianPluginDevPythonToJS.py"
success "Python client library downloaded."
else
warn "ObsidianPluginDevPythonToJS.py not found as a release asset."
warn "Will attempt to get it from source..."
fi
fi
# ββ Step C: Download the obsidian_python_bridge package from source ββ
if [[ ! -d "$plugin_dir/obsidian_python_bridge" ]]; then
info "Downloading Python bridge package (obsidian_python_bridge/) from source..."
download "$SOURCE_TARBALL_URL" "$TMPDIR/source.tar.gz"
info "Extracting Python bridge package..."
mkdir -p "$TMPDIR/source-extract"
if has_cmd tar; then
tar xzf "$TMPDIR/source.tar.gz" -C "$TMPDIR/source-extract"
else
# Python fallback for tar extraction
"$PYTHON_CMD" -c "
import tarfile
with tarfile.open('$TMPDIR/source.tar.gz', 'r:gz') as t:
t.extractall('$TMPDIR/source-extract')
"
fi
# Find the extracted directory (GitHub tarballs have a prefix like mathe00-obsidian-plugin-python-bridge-abc1234)
local source_root
source_root="$(find "$TMPDIR/source-extract" -maxdepth 1 -type d | tail -1)"
if [[ -d "$source_root/obsidian_python_bridge" ]]; then
cp -r "$source_root/obsidian_python_bridge" "$plugin_dir/"
success "Python bridge package installed."
else
warn "obsidian_python_bridge/ package not found in source tarball."
warn "The plugin may still work with the standalone library file."
fi
# Also get ObsidianPluginDevPythonToJS.py from source if we didn't get it from release
if [[ ! -f "$plugin_dir/ObsidianPluginDevPythonToJS.py" ]] && [[ -f "$source_root/ObsidianPluginDevPythonToJS.py" ]]; then
cp "$source_root/ObsidianPluginDevPythonToJS.py" "$plugin_dir/"
success "Python client library copied from source."
fi
# Also get styles.css from source if it's missing from the release zip
if [[ ! -f "$plugin_dir/styles.css" ]] && [[ -f "$source_root/styles.css" ]]; then
cp "$source_root/styles.css" "$plugin_dir/"
success "styles.css copied from source."
fi
# Clean up extracted source
rm -rf "$TMPDIR/source-extract"
fi
# ββ Verify essential files ββ
local missing_files=()
for f in main.js manifest.json; do
if [[ ! -f "$plugin_dir/$f" ]]; then
missing_files+=("$f")
fi
done
if [[ ${#missing_files[@]} -gt 0 ]]; then
error "Essential files missing after download:"
for f in "${missing_files[@]}"; do
echo -e " ${RED}β’ $f${RESET}"
done
error "Installation may be incomplete. Try re-running or install manually."
fi
}
# βββ Install Python Dependencies ββββββββββββββββββββββββββββββββββββββββββββββ
install_python_deps() {
info "Checking Python dependencies..."
# Check for requests
if "$PYTHON_CMD" -c "import requests" 2>/dev/null; then
success "requests: already installed"
else
info "Installing requests library (required for plugin communication)..."
if "$PYTHON_CMD" -m pip install requests 2>/dev/null; then
success "requests: installed"
elif has_cmd pip3 && pip3 install requests 2>/dev/null; then
success "requests: installed via pip3"
elif has_cmd pip && pip install requests 2>/dev/null; then
success "requests: installed via pip"
else
warn "Could not install 'requests' automatically."
warn "Please install it manually: ${BOLD}pip install requests${RESET}"
fi
fi
# Check for PyYAML (optional but recommended)
if "$PYTHON_CMD" -c "import yaml" 2>/dev/null; then
success "PyYAML: already installed"
else
info "Installing PyYAML (optional β for frontmatter property management)..."
if "$PYTHON_CMD" -m pip install PyYAML 2>/dev/null; then
success "PyYAML: installed"
elif has_cmd pip3 && pip3 install PyYAML 2>/dev/null; then
success "PyYAML: installed via pip3"
else
warn "Could not install 'PyYAML' automatically."
warn "You can install it later: ${BOLD}pip install PyYAML${RESET}"
fi
fi
}
# βββ Success Message ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
print_success() {
local plugin_dir="$1"
local version="$2"
echo ""
echo -e "${GREEN}${BOLD} βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ${RESET}"
echo -e "${GREEN}${BOLD} β${RESET} ${GREEN}${BOLD}β${RESET}"
echo -e "${GREEN}${BOLD} β${RESET} ${BOLD}π Installation Complete!${RESET} ${GREEN}${BOLD}β${RESET}"
echo -e "${GREEN}${BOLD} β${RESET} ${GREEN}${BOLD}β${RESET}"
echo -e "${GREEN}${BOLD} βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ${RESET}"
echo ""
echo -e " ${BOLD}Plugin version:${RESET} v${version}"
echo -e " ${BOLD}Installed to:${RESET} ${UNDERLINE}${plugin_dir}${RESET}"
echo ""
sep
echo -e "\n ${BOLD}${CYAN}Next Steps:${RESET}\n"
echo -e " ${BOLD}1.${RESET} ${BOLD}Restart Obsidian${RESET} (if it's currently running)"
echo -e " ${BOLD}2.${RESET} Go to ${BOLD}Settings β Community plugins${RESET}"
echo -e " If Safe Mode is on, turn it off."
echo -e " ${BOLD}3.${RESET} Find ${BOLD}\"Python Bridge\"${RESET} in the installed plugins list"
echo -e " ${BOLD}4.${RESET} Click the ${BOLD}toggle${RESET} to enable it"
echo -e " ${BOLD}5.${RESET} Click the ${BOLD}gear icon βοΈ${RESET} to configure:"
echo -e " β’ Set the path to your Python scripts folder"
echo -e " β’ Review security settings"
echo -e " β’ Enable/disable individual scripts"
echo ""
echo -e " ${DIM}For detailed documentation, see:${RESET}"
echo -e " ${DIM}https://github.com/mathe00/obsidian-plugin-python-bridge${RESET}"
echo ""
echo -e " ${YELLOW}β ${RESET} ${BOLD}Important:${RESET} Only run Python scripts you trust!"
echo ""
sep
echo ""
}
# βββ Main βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
main() {
# Create temp directory for downloads (auto-cleaned on exit)
TMPDIR="$(mktemp -d "${TMPDIR:-/tmp}/obsidian-python-bridge-install.XXXXXX")"
# shellcheck disable=SC2064
trap "rm -rf \"$TMPDIR\"" EXIT
print_banner
# βββ Step 1: Detect OS βββββββββββββββββββββββββββββββββββββββββ
step "1" "Detecting your system"
local os
os="$(detect_os)"
case "$os" in
linux) info "Operating System: ${BOLD}Linux${RESET}" ;;
macos) info "Operating System: ${BOLD}macOS${RESET}" ;;
wsl) info "Operating System: ${BOLD}Linux (WSL)${RESET}" ;;
*) warn "Operating System: ${BOLD}$os${RESET} (not officially tested)" ;;
esac
# βββ Step 2: Check prerequisites ββββββββββββββββββββββββββββββ
step "2" "Checking prerequisites"
check_prerequisites
# βββ Step 3: Get latest release ββββββββββββββββββββββββββββββββ
step "3" "Fetching latest release info"
get_latest_release
# βββ Step 4: Prompt for vault path βββββββββββββββββββββββββββββ
step "4" "Select your Obsidian vault"
local SELECTED_VAULT=""
prompt_vault_path
# βββ Step 5: Prepare plugin directory ββββββββββββββββββββββββββ
step "5" "Preparing plugin directory"
local plugin_dir="$SELECTED_VAULT/.obsidian/plugins/obsidian-python-bridge"
if [[ -d "$plugin_dir" ]]; then
warn "Plugin directory already exists: $plugin_dir"
if [[ -f "$plugin_dir/data.json" ]]; then
info "Your existing settings (data.json) will be ${BOLD}preserved${RESET}."
fi
ask "Overwrite plugin files with latest version? (Y/n):"
read -r overwrite_choice
if [[ "$overwrite_choice" =~ ^[Nn]$ ]]; then
info "Installation cancelled by user."
exit 0
fi
fi
mkdir -p "$plugin_dir"
success "Plugin directory ready: $plugin_dir"
# βββ Step 6: Confirmation ββββββββββββββββββββββββββββββββββββββ
step "6" "Confirm installation"
echo ""
echo -e " ${BOLD}Installation summary:${RESET}"
echo -e " Plugin: Obsidian Python Bridge v${RELEASE_TAG}"
echo -e " Install to: ${UNDERLINE}${plugin_dir}${RESET}"
echo -e " Python: $("$PYTHON_CMD" --version 2>&1 | head -1)"
echo ""
ask "Proceed with installation? (Y/n):"
read -r confirm
if [[ "$confirm" =~ ^[Nn]$ ]]; then
info "Installation cancelled by user."
exit 0
fi
# βββ Step 7: Download and install ββββββββββββββββββββββββββββββ
step "7" "Downloading and installing plugin files"
install_plugin_files "$plugin_dir" "$RELEASE_TAG"
# βββ Step 8: Install Python dependencies βββββββββββββββββββββββ
step "8" "Installing Python dependencies"
install_python_deps
# βββ Step 9: Success! ββββββββββββββββββββββββββββββββββββββββββ
print_success "$plugin_dir" "$RELEASE_TAG"
}
# Run main function
main "$@"