File tree 1 file changed +8
-4
lines changed
packages/lobe-i18n/src/commands/TranslateLocale
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -97,8 +97,10 @@ class TranslateLocale {
97
97
98
98
for ( const locale of config . outputLocales ) {
99
99
for ( const [ index , filename ] of files . entries ( ) ) {
100
- process . stdout . clearLine ( 0 ) ;
101
- process . stdout . cursorTo ( 0 ) ;
100
+ if ( process . stdout . isTTY ) {
101
+ process . stdout . clearLine ( 0 ) ;
102
+ process . stdout . cursorTo ( 0 ) ;
103
+ }
102
104
103
105
process . stdout . write (
104
106
`${ chalk . cyan ( locale ) } ${ chalk . gray ( `[${ index + 1 } /${ files . length } ] - ` ) } ${ chalk . yellow ( filename ) } ` ,
@@ -118,8 +120,10 @@ class TranslateLocale {
118
120
}
119
121
}
120
122
121
- process . stdout . clearLine ( 0 ) ;
122
- process . stdout . cursorTo ( 0 ) ;
123
+ if ( process . stdout . isTTY ) {
124
+ process . stdout . clearLine ( 0 ) ;
125
+ process . stdout . cursorTo ( 0 ) ;
126
+ }
123
127
}
124
128
125
129
genFlatQuery ( ) {
You can’t perform that action at this time.
0 commit comments