embersparks_obsidian-github.../deploy.example.bat
EmberSparks af98fdfe7d chore: 移除个人路径信息,提供通用 example 部署文件
- 从 git 跟踪移除含个人路径的部署脚本(deploy.bat, deploy-wsl.sh 等)
- 新增 deploy.example.bat 和 deploy-wsl.example.sh 供用户自定义
- .env.example 改为通用占位符路径
- CLAUDE.md 部署命令改用环境变量引用
- esbuild.config.mjs 移除 Node 22 不兼容的 setEncoding 调用和中文路径 hack
- .gitignore 补充 deploy-wsl.sh

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-06-12 14:45:21 +08:00

52 lines
1.3 KiB
Batchfile

@echo off
chcp 65001 >nul
echo Deploy Obsidian GitHub Stars Manager Plugin
echo ==========================================
echo.
:: Read plugin directory from environment variable
:: Set this via: setx OBSIDIAN_PLUGIN_DIR "your-path"
:: Or create a .env file with OBSIDIAN_PLUGIN_DIR="your-path"
if "%OBSIDIAN_PLUGIN_DIR%"=="" (
echo Error: OBSIDIAN_PLUGIN_DIR environment variable is not set.
echo Please run: setx OBSIDIAN_PLUGIN_DIR "C:\Users\YourName\YourVault\.obsidian\plugins"
echo Or copy .env.example to .env and set the path there.
pause
exit /b 1
)
set "TARGET_DIR=%OBSIDIAN_PLUGIN_DIR%\github-stars-manager"
echo Target: %TARGET_DIR%
echo.
if not exist "%TARGET_DIR%" (
echo Creating target directory...
mkdir "%TARGET_DIR%"
)
echo Deploying...
echo.
if exist "main.js" (
copy "main.js" "%TARGET_DIR%\main.js" >nul
echo Done: main.js
) else (
echo Warning: main.js not found, run npm run build first
)
if exist "styles.css" (
copy "styles.css" "%TARGET_DIR%\styles.css" >nul
echo Done: styles.css
)
if exist "manifest.json" (
copy "manifest.json" "%TARGET_DIR%\manifest.json" >nul
echo Done: manifest.json
)
echo.
echo Deploy complete: %TARGET_DIR%
echo Reload the plugin in Obsidian to see changes.
echo.
pause