obsidian-plugin-config 1.7.5 → 1.7.6
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/bin/obsidian-inject.js
CHANGED
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import { join } from 'path';
|
|
|
4
4
|
import {
|
|
5
5
|
askConfirmation,
|
|
6
6
|
askQuestion,
|
|
7
|
+
cleanInput,
|
|
7
8
|
createReadlineInterface,
|
|
8
9
|
gitExec,
|
|
9
10
|
gitOutput,
|
|
@@ -71,12 +72,12 @@ async function createTag(): Promise<void> {
|
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
async function doCommit(currentVersion: string | undefined, tag: string): Promise<void> {
|
|
74
|
-
const
|
|
75
|
+
const raw = await askQuestion(
|
|
75
76
|
`Enter the commit message for version ${currentVersion}: `,
|
|
76
77
|
rl
|
|
77
78
|
);
|
|
78
79
|
rl.close();
|
|
79
|
-
await doNextSteps(
|
|
80
|
+
await doNextSteps(cleanInput(raw), tag);
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
async function doNextSteps(message: string, tag: string): Promise<void> {
|
|
@@ -87,12 +88,15 @@ async function doNextSteps(message: string, tag: string): Promise<void> {
|
|
|
87
88
|
|
|
88
89
|
try {
|
|
89
90
|
gitExec('git add -A');
|
|
90
|
-
|
|
91
|
+
const status = gitOutput('git status --porcelain');
|
|
92
|
+
if (status) {
|
|
93
|
+
gitExec('git commit -m "update tag description"');
|
|
91
94
|
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
// Ensure Git is synchronized before pushing
|
|
96
|
+
await ensureGitSync();
|
|
94
97
|
|
|
95
|
-
|
|
98
|
+
gitExec('git push');
|
|
99
|
+
}
|
|
96
100
|
} catch (error: unknown) {
|
|
97
101
|
console.error('Error:', error instanceof Error ? error.message : String(error));
|
|
98
102
|
}
|