File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,17 @@ import simpleGit from 'simple-git';
77const types = [ 'major' , 'minor' , 'patch' ] ;
88
99async function bump ( type : ReleaseType = 'patch' ) {
10+ const git = simpleGit ( ) ;
11+
12+ // Check for staged changes
13+ const status = await git . status ( ) ;
14+ if ( status . staged . length > 0 ) {
15+ console . error ( 'Error: You have staged changes. Please commit or unstage them before bumping the version.' ) ;
16+ console . error ( 'Staged files:' ) ;
17+ status . staged . forEach ( file => console . error ( ` - ${ file } ` ) ) ;
18+ process . exit ( 1 ) ;
19+ }
20+
1021 const packageFile = require . resolve ( '../package.json' ) ;
1122 const packageJSON = require ( packageFile ) as Required < PackageJson > ;
1223
@@ -32,7 +43,6 @@ async function bump(type: ReleaseType = 'patch') {
3243 await writeFile ( uiPackageFile , JSON . stringify ( uiPackageJSON , null , 2 ) + '\n' ) ;
3344
3445 // Create git tag
35- const git = simpleGit ( ) ;
3646 const tagName = `radio@v${ version } ` ;
3747
3848 await git . add ( [
You can’t perform that action at this time.
0 commit comments