diff --git a/.gitignore b/.gitignore index e5f04810..599324d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # vscode -.vscode +.vscode # Intellij *.iml @@ -44,3 +44,10 @@ plans # Project planning files project + + +# Exclude local test vaults and e2e cache artifacts +external/tasknotes-e2e/.e2e/ +C/ + +.copy-files.local diff --git a/copy-files.mjs b/copy-files.mjs index ad9f4716..f1c1acd1 100644 --- a/copy-files.mjs +++ b/copy-files.mjs @@ -1,13 +1,21 @@ #!/usr/bin/env node -import { copyFile, mkdir, access, constants } from 'fs/promises'; +import { copyFile, mkdir, access, constants, readFile } from 'fs/promises'; import { join, resolve } from 'path'; import os from 'os'; // Default copy destination - can be overridden with OBSIDIAN_PLUGIN_PATH environment variable // Use os.homedir() to avoid literal "$HOME" not being expanded by Node const defaultPath = join(os.homedir(), 'testvault', 'test', '.obsidian', 'plugins', 'tasknotes'); -const copyPath = process.env.OBSIDIAN_PLUGIN_PATH || defaultPath; +const LOCAL_OVERRIDE_FILE = '.copy-files.local'; +let copyPath = process.env.OBSIDIAN_PLUGIN_PATH || defaultPath; +try { + const local = await readFile(LOCAL_OVERRIDE_FILE, 'utf8'); + const trimmed = local.trim(); + if (trimmed) copyPath = trimmed; +} catch (_) { + // no local override +} // Files to copy after build const files = ['main.js', 'styles.css', 'manifest.json'];