-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·45 lines (36 loc) · 1.36 KB
/
deploy.sh
File metadata and controls
executable file
·45 lines (36 loc) · 1.36 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
#!/bin/bash
# Build and deploy xTermObsidian plugin
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PLUGIN_DIR_NAME="obsidian-term"
TARGET_DIR="/Users/fengzheng/知识管理/风筝记/.obsidian/plugins/${PLUGIN_DIR_NAME}"
RELEASES_ROOT="${SCRIPT_DIR}/releases"
MACOS_RELEASE_DIR="${RELEASES_ROOT}/macos/${PLUGIN_DIR_NAME}"
copy_plugin_bundle() {
local destination_dir="$1"
mkdir -p "$destination_dir"
rm -rf "$destination_dir/resources" "$destination_dir/themes"
mkdir -p "$destination_dir/resources" "$destination_dir/themes"
cp "$SCRIPT_DIR/main.js" "$destination_dir/"
cp "$SCRIPT_DIR/manifest.json" "$destination_dir/"
cp "$SCRIPT_DIR/styles.css" "$destination_dir/"
cp "$SCRIPT_DIR/resources/pty-helper" "$destination_dir/resources/"
cp -R "$SCRIPT_DIR/themes/." "$destination_dir/themes/"
}
echo "🔨 Building plugin..."
cd "$SCRIPT_DIR"
npm run build
echo "📁 Deploying to local Obsidian plugin directory..."
copy_plugin_bundle "$TARGET_DIR"
echo "📦 Creating macOS release bundle..."
mkdir -p "$RELEASES_ROOT/macos"
copy_plugin_bundle "$MACOS_RELEASE_DIR"
chmod +x "$RELEASES_ROOT/macos/install.sh"
echo "✅ Deployed to: $TARGET_DIR"
echo "✅ macOS release bundle: $MACOS_RELEASE_DIR"
echo ""
echo "📋 Local plugin files:"
ls -la "$TARGET_DIR"
echo ""
echo "📋 macOS release files:"
ls -la "$MACOS_RELEASE_DIR"