File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6565 mkdir -p android/fastlane/metadata/android/en-US/changelogs
6666
6767 if [ -f changelog.txt ]; then
68- char_count=$(wc -m < changelog.txt)
69-
70- if [ "$char_count" -gt 500 ]; then
71- cut -c1-497 changelog.txt > "android/fastlane/metadata/android/en-US/changelogs/${BUILD_VERSION}.txt"
72- printf "..." >> "android/fastlane/metadata/android/en-US/changelogs/${BUILD_VERSION}.txt"
73- else
74- cat changelog.txt > "android/fastlane/metadata/android/en-US/changelogs/${BUILD_VERSION}.txt"
75- fi
68+ node .github/scripts/prepare-changelog.js
7669 else
7770 printf "Internal improvements and bug fixes" > "android/fastlane/metadata/android/en-US/changelogs/${BUILD_VERSION}.txt"
7871 fi
Original file line number Diff line number Diff line change 1+ const fs = require ( "fs" ) ;
2+
3+ const buildVersion = process . env . BUILD_VERSION ;
4+ const input = fs . readFileSync ( "changelog.txt" , "utf8" ) ;
5+
6+ const segmenter = new Intl . Segmenter ( "en" , { granularity : "grapheme" } ) ;
7+ const chars = Array . from ( segmenter . segment ( input ) , s => s . segment ) ;
8+
9+ let output ;
10+ if ( chars . length > 500 ) {
11+ output = chars . slice ( 0 , 497 ) . join ( "" ) + "..." ;
12+ } else {
13+ output = input ;
14+ }
15+
16+ fs . writeFileSync (
17+ `android/fastlane/metadata/android/en-US/changelogs/${ buildVersion } .txt` ,
18+ output ,
19+ "utf8"
20+ ) ;
You can’t perform that action at this time.
0 commit comments