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 = {
2626 'no-unused-vars' : 0 ,
2727 'indent' : 0 ,
2828 'no-dupe-class-members' : 0 ,
29+ 'no-console' : 1 ,
2930 'unicorn/import-index' : 0 ,
3031 'unicorn/catch-error-name' : 0 ,
3132 'import/newline-after-import' : 0 ,
Original file line number Diff line number Diff line change @@ -5,3 +5,9 @@ import * as lib from './index';
55it ( 'smoke' , ( ) => {
66 expect ( lib ) . toBeTruthy ( ) ;
77} ) ;
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) {
88 tagsOption = `--tags="${ match } "` ;
99 }
1010 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 ( ) ;
1213}
1314
1415/**
You can’t perform that action at this time.
0 commit comments