File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ module.exports = {
26
26
'no-unused-vars' : 0 ,
27
27
'indent' : 0 ,
28
28
'no-dupe-class-members' : 0 ,
29
+ 'no-console' : 1 ,
29
30
'unicorn/import-index' : 0 ,
30
31
'unicorn/catch-error-name' : 0 ,
31
32
'import/newline-after-import' : 0 ,
Original file line number Diff line number Diff line change @@ -5,3 +5,9 @@ import * as lib from './index';
5
5
it ( 'smoke' , ( ) => {
6
6
expect ( lib ) . toBeTruthy ( ) ;
7
7
} ) ;
8
+
9
+ it ( 'new line is trimmed' , ( ) => {
10
+ const result = lib . getLastTagSync ( ) ;
11
+ expect ( result . slice ( - 1 ) ) . toNotEqual ( '\n' ) ;
12
+ } ) ;
13
+
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ export function getLastTagSync(match?: string) {
8
8
tagsOption = `--tags="${ match } "` ;
9
9
}
10
10
const ref = execSync ( `git rev-list --max-count=1 ${ tagsOption } ` , { encoding : 'utf8' } ) ;
11
- return execSync ( `git describe --tags ${ ref } ` , { encoding : 'utf8' } ) ;
11
+ const result = execSync ( `git describe --tags ${ ref } ` , { encoding : 'utf8' } ) ;
12
+ return result . trim ( ) ;
12
13
}
13
14
14
15
/**
You can’t perform that action at this time.
0 commit comments