mirror of
https://github.com/wahyd4/say-it.git
synced 2026-08-09 05:06:41 +10:00
Fix the bug of when there is no default person to pronounce
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "say-it",
|
||||
"version": "0.1.3",
|
||||
"version": "0.1.4",
|
||||
"description": "Read the text you typed in command line by using Baidu tts.",
|
||||
"main": "say-it.js",
|
||||
"bin": {
|
||||
|
||||
@@ -20,7 +20,7 @@ var person = 0
|
||||
charm.pipe(process.stdout);
|
||||
|
||||
program
|
||||
.version('0.0.1')
|
||||
.version('0.1')
|
||||
.command(' ', 'read the texts you typed in', {
|
||||
isDefault: true
|
||||
})
|
||||
@@ -31,7 +31,8 @@ program.on('*', () => {
|
||||
if (!text || text.trim() === '') {
|
||||
return showError()
|
||||
}
|
||||
if (!_.includes([0, 1, 2, 3, 4], Number.parseInt(program.person))) {
|
||||
|
||||
if (!!program.person && !_.includes([0, 1, 2, 3, 4], Number.parseInt(program.person))) {
|
||||
return showError(TEXTS.invalidPerson)
|
||||
}
|
||||
person = Number.parseInt(program.person)
|
||||
|
||||
Reference in New Issue
Block a user