obsidian-plugin-config 1.4.8 ā 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/tasks.json +1 -1
- package/README.md +147 -192
- package/bin/obsidian-inject.js +8 -1
- package/package.json +1 -1
- package/scripts/build-npm.ts +357 -346
- package/scripts/inject-core.ts +725 -725
- package/scripts/inject-path.ts +10 -0
- package/scripts/inject-prompt.ts +11 -0
- package/versions.json +2 -1
package/scripts/inject-path.ts
CHANGED
|
@@ -44,6 +44,16 @@ async function main(): Promise<void> {
|
|
|
44
44
|
process.exit(1);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
// Prevent injecting into obsidian-plugin-config itself
|
|
48
|
+
const selfPkg = path.join(resolvedPath, 'package.json');
|
|
49
|
+
if (fs.existsSync(selfPkg)) {
|
|
50
|
+
const pkg = JSON.parse(fs.readFileSync(selfPkg, 'utf8'));
|
|
51
|
+
if (pkg.name === 'obsidian-plugin-config') {
|
|
52
|
+
console.error(`ā Cannot inject into obsidian-plugin-config itself.`);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
47
57
|
console.log(`š Target directory: ${resolvedPath}`);
|
|
48
58
|
console.log(`\nš Analyzing plugin...`);
|
|
49
59
|
const plan = await analyzePlugin(resolvedPath);
|
package/scripts/inject-prompt.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env tsx
|
|
2
2
|
|
|
3
|
+
import fs from 'fs';
|
|
3
4
|
import path from 'path';
|
|
4
5
|
import {
|
|
5
6
|
analyzePlugin,
|
|
@@ -71,6 +72,16 @@ async function main(): Promise<void> {
|
|
|
71
72
|
targetPath = await promptForTargetPath();
|
|
72
73
|
}
|
|
73
74
|
|
|
75
|
+
// Prevent injecting into obsidian-plugin-config itself
|
|
76
|
+
const selfPkg = path.join(targetPath, 'package.json');
|
|
77
|
+
if (fs.existsSync(selfPkg)) {
|
|
78
|
+
const pkg = JSON.parse(fs.readFileSync(selfPkg, 'utf8'));
|
|
79
|
+
if (pkg.name === 'obsidian-plugin-config') {
|
|
80
|
+
console.error(`ā Cannot inject into obsidian-plugin-config itself.`);
|
|
81
|
+
process.exit(1);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
74
85
|
console.log(`\nš Checking plugin-config repository status...`);
|
|
75
86
|
await ensurePluginConfigClean();
|
|
76
87
|
|