mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-11-17 21:53:03 +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
|
- .yarnCache
|
||||||
script:
|
script:
|
||||||
- yarn i18n:extract
|
- yarn i18n:extract
|
||||||
- yes | yarn i18n:push
|
- yarn i18n:push
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "Source strings for $CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA"
|
name: "Source strings for $CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA"
|
||||||
paths:
|
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;
|
let branchId: number|undefined;
|
||||||
if (publishInBranch) {
|
if (publishInBranch) {
|
||||||
@ -336,19 +347,21 @@ async function push(): Promise<void> {
|
|||||||
console.log(ch.green('Success'));
|
console.log(ch.green('Success'));
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
(async() => {
|
||||||
const action = process.argv[2];
|
try {
|
||||||
|
const action = process.argv[2];
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 'pull':
|
case 'pull':
|
||||||
pull();
|
await pull();
|
||||||
break;
|
break;
|
||||||
case 'push':
|
case 'push':
|
||||||
push();
|
await push();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.error(`Unknown action ${action}`);
|
console.error(`Unknown action ${action}`);
|
||||||
|
}
|
||||||
|
} catch (exception) {
|
||||||
|
console.error(exception);
|
||||||
}
|
}
|
||||||
} catch (exception) {
|
})();
|
||||||
console.error(exception);
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user