@bobfrankston/npmglobalize 1.0.72 → 1.0.73
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/lib.js +5 -1
- package/package.json +1 -1
package/lib.js
CHANGED
|
@@ -1180,7 +1180,11 @@ export async function initGit(cwd, visibility, dryRun) {
|
|
|
1180
1180
|
runCommandOrThrow('git', ['config', 'core.eol', 'lf'], { cwd });
|
|
1181
1181
|
console.log(' ✓ Configured git for LF line endings');
|
|
1182
1182
|
runCommandOrThrow('git', ['add', '-A'], { cwd });
|
|
1183
|
-
|
|
1183
|
+
// Only commit if there are staged changes (repo may already have commits)
|
|
1184
|
+
const staged = spawnSync('git', ['diff', '--cached', '--quiet'], { cwd });
|
|
1185
|
+
if (staged.status !== 0) {
|
|
1186
|
+
runCommandOrThrow('git', ['commit', '-m', 'Initial commit'], { cwd });
|
|
1187
|
+
}
|
|
1184
1188
|
// Create GitHub repo
|
|
1185
1189
|
const visFlag = visibility === 'private' ? '--private' : '--public';
|
|
1186
1190
|
runCommandOrThrow('gh', ['repo', 'create', repoName, visFlag, '--source=.', '--push'], { cwd });
|