Skip to content

Commit 89ec84c

Browse files
author
Beren
committed
[count] output format 통일
1 parent 5a338ef commit 89ec84c

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

src/l10n-cli.js

+5-17
Original file line numberDiff line numberDiff line change
@@ -160,23 +160,11 @@ async function run () {
160160
const specs = cmd.spec ? cmd.spec.split(',') : ['total']
161161

162162
const poDir = path.join(cmd.podir || i18nDir, domainName)
163-
let countOutput = ''
164-
if (locales.length === 1) {
165-
const poPath = path.join(poDir, locales[0] + '.po')
166-
countOutput = countPoEntries(poPath, specs)
167-
} else if (locales.length > 1) {
168-
const counts = locales.map(locale => {
169-
const poPath = path.join(poDir, locale + '.po')
170-
return locale + ':' + countPoEntries(poPath, specs)
171-
})
172-
countOutput = counts.join(',')
173-
}
174-
175-
if (domainNames.length > 1) {
176-
process.stdout.write(`${domainName},${countOutput}\n`)
177-
} else {
178-
process.stdout.write(`${countOutput}\n`)
179-
}
163+
const counts = locales.map(locale => {
164+
const poPath = path.join(poDir, locale + '.po')
165+
return locale + ':' + countPoEntries(poPath, specs)
166+
})
167+
process.stdout.write(`${domainName},${counts.join(',')}\n`)
180168
break
181169
}
182170

0 commit comments

Comments
 (0)