mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-11-10 01:52:04 +05:30
Fix errors catching in i18n-crowdin script.
Detect non tty environment and apply defaults.
This commit is contained in:
parent
8194f8d106
commit
c3b778e3ca
@ -127,7 +127,7 @@ Crowdin push:
|
||||
- .yarnCache
|
||||
script:
|
||||
- yarn i18n:extract
|
||||
- yes | yarn i18n:push
|
||||
- yarn i18n:push
|
||||
artifacts:
|
||||
name: "Source strings for $CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA"
|
||||
paths:
|
||||
|
@ -277,7 +277,18 @@ async function push(): Promise<void> {
|
||||
});
|
||||
}
|
||||
|
||||
const { disapproveTranslates, publishInBranch = false } = await prompt(questions);
|
||||
let disapproveTranslates = true;
|
||||
let publishInBranch = false;
|
||||
try {
|
||||
const answers = await prompt(questions);
|
||||
disapproveTranslates = answers[0];
|
||||
publishInBranch = answers[1] || false;
|
||||
} catch (err) {
|
||||
// okay if it's tty error
|
||||
if (!err.isTtyError) {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
let branchId: number|undefined;
|
||||
if (publishInBranch) {
|
||||
@ -336,19 +347,21 @@ async function push(): Promise<void> {
|
||||
console.log(ch.green('Success'));
|
||||
}
|
||||
|
||||
try {
|
||||
const action = process.argv[2];
|
||||
(async() => {
|
||||
try {
|
||||
const action = process.argv[2];
|
||||
|
||||
switch (action) {
|
||||
case 'pull':
|
||||
pull();
|
||||
break;
|
||||
case 'push':
|
||||
push();
|
||||
break;
|
||||
default:
|
||||
console.error(`Unknown action ${action}`);
|
||||
switch (action) {
|
||||
case 'pull':
|
||||
await pull();
|
||||
break;
|
||||
case 'push':
|
||||
await push();
|
||||
break;
|
||||
default:
|
||||
console.error(`Unknown action ${action}`);
|
||||
}
|
||||
} catch (exception) {
|
||||
console.error(exception);
|
||||
}
|
||||
} catch (exception) {
|
||||
console.error(exception);
|
||||
}
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user