@vocoder/cli 0.1.22 → 0.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.mjs +11 -6
- package/dist/bin.mjs.map +1 -1
- package/package.json +1 -1
package/dist/bin.mjs
CHANGED
|
@@ -3600,17 +3600,22 @@ async function sync(options = {}) {
|
|
|
3600
3600
|
}
|
|
3601
3601
|
if (error instanceof Error) {
|
|
3602
3602
|
p8.log.error(error.message);
|
|
3603
|
-
|
|
3603
|
+
const isInvalidKey = error.message.toLowerCase().includes("invalid api key") || error instanceof VocoderAPIError && error.status === 401;
|
|
3604
|
+
if (isInvalidKey) {
|
|
3604
3605
|
p8.log.warn(
|
|
3605
|
-
"
|
|
3606
|
+
"API key rejected \u2014 the project may have been deleted or the key revoked."
|
|
3606
3607
|
);
|
|
3607
|
-
p8.log.info(
|
|
3608
|
-
|
|
3608
|
+
p8.log.info(
|
|
3609
|
+
" Run `npx @vocoder/cli init` to create a new project and key."
|
|
3610
|
+
);
|
|
3611
|
+
} else if (error.message.includes("VOCODER_API_KEY")) {
|
|
3612
|
+
p8.log.info(" Get an API key at: https://vocoder.app/dashboard");
|
|
3613
|
+
p8.log.info(' Then add to .env: VOCODER_API_KEY="vcp_..."');
|
|
3609
3614
|
p8.log.info("");
|
|
3610
3615
|
p8.log.info(
|
|
3611
|
-
" Note:
|
|
3616
|
+
" Note: if you use @vocoder/unplugin, `vocoder sync` is optional \u2014"
|
|
3612
3617
|
);
|
|
3613
|
-
p8.log.info("
|
|
3618
|
+
p8.log.info(" translations are fetched automatically at build time.");
|
|
3614
3619
|
} else if (error.message.includes("git branch")) {
|
|
3615
3620
|
p8.log.warn("Run from a git repository, or use:");
|
|
3616
3621
|
p8.log.info(" vocoder sync --branch main");
|