Audit: remove personal deploy paths and clarify plugin purpose in README.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Andre482 2026-06-12 15:06:33 +03:00
parent f09015e70f
commit 5ac0a990c3
4 changed files with 51 additions and 27 deletions

2
.gitignore vendored
View file

@ -3,3 +3,5 @@ main.js
main.js.map
.DS_Store
*.log
deploy.local.mjs
deploy.local.ps1

View file

@ -1,6 +1,12 @@
# O-Tie
Build and edit **risk bowtie diagrams** in Obsidian with an interactive visual editor. O-Tie stores diagrams as `.bowtie` JSON files in your vault and auto-saves as you work.
Build and edit **risk bowtie diagrams** in Obsidian with an interactive visual editor.
## What is O-Tie?
O-Tie is an Obsidian plugin for **bowtie risk analysis** — a visual method used in process safety, operations, and HSE work to show how a hazard can lead to a top event (loss of control), which threats can cause it, which consequences may follow, and which barriers prevent or reduce harm.
Instead of drawing bowties in a separate tool, you create and maintain them as `.bowtie` files inside your vault. O-Tie provides a dedicated editor with pan/zoom, barrier stacks, escalation factors, undo/redo, and PNG export. Changes auto-save as you edit.
## Features
@ -91,6 +97,19 @@ npm run dev # watch mode
npm run build # production build
```
To deploy a local build into a vault:
```bash
# Unix / macOS / Git Bash
OBSIDIAN_PLUGIN_DIR="/path/to/vault/.obsidian/plugins/o-tie" npm run deploy
```
```powershell
# Windows PowerShell
$env:OBSIDIAN_VAULT_PATH = "C:\path\to\vault"
.\deploy.ps1
```
## Third-party licenses
This plugin bundles [html-to-image](https://github.com/bubkoo/html-to-image) (MIT) for PNG export.

View file

@ -2,18 +2,22 @@ import { copyFileSync, existsSync, mkdirSync } from "fs";
import { join } from "path";
const files = ["main.js", "styles.css", "manifest.json"];
const vaults = [
"C:/Users/User/OneDrive/Obsidian/Andre482/.obsidian/plugins/o-tie",
"C:/Users/User/OneDrive/Obsidian/.obsidian/plugins/o-tie",
"C:/Users/User/OneDrive/Obsidian/Bowties/.obsidian/plugins/o-tie",
];
const target = process.env.OBSIDIAN_PLUGIN_DIR;
for (const vault of vaults) {
if (!existsSync(vault)) {
mkdirSync(vault, { recursive: true });
}
for (const file of files) {
copyFileSync(join(process.cwd(), file), join(vault, file));
}
console.log(`Deployed to ${vault}`);
if (!target) {
console.error(
"Set OBSIDIAN_PLUGIN_DIR to your plugin folder, e.g.\n" +
' OBSIDIAN_PLUGIN_DIR="C:/path/to/vault/.obsidian/plugins/o-tie" npm run deploy'
);
process.exit(1);
}
if (!existsSync(target)) {
mkdirSync(target, { recursive: true });
}
for (const file of files) {
copyFileSync(join(process.cwd(), file), join(target, file));
}
console.log(`Deployed to ${target}`);

View file

@ -1,6 +1,15 @@
# Deploy O-Tie plugin to the active Obsidian vault
$vaultPath = "C:\Users\User\OneDrive\Obsidian"
$pluginDir = Join-Path $vaultPath ".obsidian\plugins\o-tie"
# Deploy O-Tie to a local Obsidian vault (developer use only).
# Set OBSIDIAN_VAULT_PATH to your vault root, or pass -VaultPath.
param(
[string]$VaultPath = $env:OBSIDIAN_VAULT_PATH
)
if (-not $VaultPath) {
Write-Error "Set OBSIDIAN_VAULT_PATH or pass -VaultPath to your Obsidian vault root."
exit 1
}
$pluginDir = Join-Path $VaultPath ".obsidian\plugins\o-tie"
$sourceDir = $PSScriptRoot
Write-Host "Building plugin..."
@ -15,14 +24,4 @@ Copy-Item (Join-Path $sourceDir "main.js") -Destination $pluginDir -Force
Copy-Item (Join-Path $sourceDir "manifest.json") -Destination $pluginDir -Force
Copy-Item (Join-Path $sourceDir "styles.css") -Destination $pluginDir -Force
$communityPlugins = Join-Path $vaultPath ".obsidian\community-plugins.json"
$enabled = @("o-tie")
if (Test-Path $communityPlugins) {
$existing = Get-Content $communityPlugins -Raw | ConvertFrom-Json
foreach ($id in $existing) {
if ($id -ne "o-tie") { $enabled = @($id) + $enabled }
}
}
$enabled | ConvertTo-Json | Set-Content $communityPlugins -Encoding UTF8
Write-Host "Done. Reload Obsidian (Ctrl+R) to activate O-Tie."