skillsets 0.5.1 → 0.5.2
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/dist/commands/submit.js +8 -2
- package/package.json +1 -1
package/dist/commands/submit.js
CHANGED
|
@@ -176,8 +176,11 @@ export async function submit() {
|
|
|
176
176
|
// Create branch
|
|
177
177
|
spinner.text = 'Creating branch...';
|
|
178
178
|
spawnSync('git', ['checkout', '-b', branchName], { cwd: tempDir, stdio: 'ignore' });
|
|
179
|
-
// Create skillset directory
|
|
179
|
+
// Create skillset directory (remove existing for clean update)
|
|
180
180
|
const skillsetDir = join(tempDir, 'skillsets', `@${skillset.author}`, skillset.name);
|
|
181
|
+
if (existsSync(skillsetDir)) {
|
|
182
|
+
rmSync(skillsetDir, { recursive: true, force: true });
|
|
183
|
+
}
|
|
181
184
|
mkdirSync(skillsetDir, { recursive: true });
|
|
182
185
|
// Copy files
|
|
183
186
|
spinner.text = 'Copying skillset files...';
|
|
@@ -193,7 +196,10 @@ export async function submit() {
|
|
|
193
196
|
const commitMsg = isUpdate
|
|
194
197
|
? `Update ${skillsetId} to v${skillset.version}`
|
|
195
198
|
: `Add ${skillsetId}`;
|
|
196
|
-
spawnSync('git', ['commit', '-m', commitMsg], { cwd: tempDir,
|
|
199
|
+
const commitResult = spawnSync('git', ['commit', '-m', commitMsg], { cwd: tempDir, encoding: 'utf-8' });
|
|
200
|
+
if (commitResult.status !== 0) {
|
|
201
|
+
throw new Error('No changes detected between local files and registry. Verify your files differ from the published version.');
|
|
202
|
+
}
|
|
197
203
|
// Push to user's fork (contributors don't have push access to upstream)
|
|
198
204
|
spinner.text = 'Pushing to fork...';
|
|
199
205
|
execSync('gh auth setup-git', { cwd: tempDir, stdio: 'ignore' });
|