@gasket/plugin-git
Advanced tools
Comparing version 7.0.0-next.25 to 7.0.0-next.26
@@ -8,1 +8,6 @@ import type { Gitignore } from './internal'; | ||
} | ||
export default { | ||
name: '@gasket/plugin-git', | ||
hooks: {} | ||
}; |
@@ -18,19 +18,20 @@ /// <reference types="@gasket/cli" /> | ||
if (gitInit) { | ||
// Init a git repo | ||
await runShellCommand('git', ['init'], { cwd }); | ||
try { | ||
// Init a git repo | ||
await runShellCommand('git', ['init'], { cwd }); | ||
// Use `main` branch | ||
await runShellCommand('git', ['checkout', '-b', 'main'], { cwd }); | ||
// Use `main` branch | ||
await runShellCommand('git', ['checkout', '-b', 'main'], { cwd }); | ||
// Add all files | ||
await runShellCommand('git', ['add', '.'], { cwd }); | ||
// Add all files | ||
await runShellCommand('git', ['add', '.'], { cwd }); | ||
// Create a commit | ||
await runShellCommand( | ||
'git', | ||
['commit', '-m', ':tada: Created new repository with gasket create'], | ||
{ cwd } | ||
); | ||
// Create a commit | ||
await runShellCommand('git', ['commit', '-m', ':tada: Created new repository with gasket create'], { cwd }); | ||
} catch (err) { | ||
const exists = err.stderr.includes('fatal: a branch named \'main\' already exists'); | ||
context.warnings.push(exists ? 'A branch named \'main\' already exists' : err.stderr); | ||
} | ||
} | ||
} | ||
}; |
{ | ||
"name": "@gasket/plugin-git", | ||
"version": "7.0.0-next.25", | ||
"version": "7.0.0-next.26", | ||
"description": "Adds git support to your application", | ||
"main": "lib", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"files": [ | ||
@@ -42,3 +43,3 @@ "generator", | ||
"dependencies": { | ||
"@gasket/utils": "^7.0.0-next.25" | ||
"@gasket/utils": "^7.0.0-next.26" | ||
}, | ||
@@ -69,3 +70,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "0782b4f4d07d18fb6bd44ecaab3e6bdafd6d4c9d" | ||
"gitHead": "b885d3f60fc68f944186105b1c4adb6440817581" | ||
} |
11103
173
Updated@gasket/utils@^7.0.0-next.26