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.
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Obsidian Plugin Config - CLI Entry Point
5
5
  * Global command: obsidian-inject
6
- * Version: 1.7.5
6
+ * Version: 1.7.6
7
7
  */
8
8
 
9
9
  import { execSync } from 'child_process';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obsidian-plugin-config",
3
- "version": "1.7.5",
3
+ "version": "1.7.6",
4
4
  "description": "Global CLI injection tool for Obsidian plugins",
5
5
  "type": "module",
6
6
  "bin": {
@@ -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 message = await askQuestion(
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(message, tag);
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
- gitExec('git commit -m "update tag description"');
91
+ const status = gitOutput('git status --porcelain');
92
+ if (status) {
93
+ gitExec('git commit -m "update tag description"');
91
94
 
92
- // Ensure Git is synchronized before pushing
93
- await ensureGitSync();
95
+ // Ensure Git is synchronized before pushing
96
+ await ensureGitSync();
94
97
 
95
- gitExec('git push');
98
+ gitExec('git push');
99
+ }
96
100
  } catch (error: unknown) {
97
101
  console.error('Error:', error instanceof Error ? error.message : String(error));
98
102
  }