Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use astro cli command instead of astro db's #11070

Merged
merged 3 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/metal-rocks-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/db": patch
---

Fixes some error messages not using the proper command to login or sync the project
6 changes: 3 additions & 3 deletions packages/db/src/core/cli/commands/link/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ async function getWorkspaceId(): Promise<string> {
if (res.status === 401) {
throw new Error(
`${bgRed('Unauthorized')}\n\n Are you logged in?\n Run ${cyan(
'astro db login'
'astro login'
)} to authenticate and then try linking again.\n\n`
);
}
Expand Down Expand Up @@ -116,7 +116,7 @@ export async function createNewProject({
if (res.status === 401) {
console.error(
`${bgRed('Unauthorized')}\n\n Are you logged in?\n Run ${cyan(
'astro db login'
'astro login'
)} to authenticate and then try linking again.\n\n`
);
process.exit(1);
Expand Down Expand Up @@ -150,7 +150,7 @@ export async function promptExistingProjectName({ workspaceId }: { workspaceId:
if (res.status === 401) {
console.error(
`${bgRed('Unauthorized')}\n\n Are you logged in?\n Run ${cyan(
'astro db login'
'astro login'
)} to authenticate and then try linking again.\n\n`
);
process.exit(1);
Expand Down
6 changes: 3 additions & 3 deletions packages/db/src/core/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ export const MISSING_SESSION_ID_CI_ERROR = `${red('▶ ASTRO_STUDIO_APP_TOKEN re
export const MISSING_SESSION_ID_ERROR = `${red('▶ Login required!')}

To authenticate with Astro Studio, run
${cyan('astro db login')}\n`;
${cyan('astro login')}\n`;

export const MISSING_PROJECT_ID_ERROR = `${red('▶ Directory not linked.')}

To link this directory to an Astro Studio project, run
${cyan('astro db link')}\n`;
${cyan('astro link')}\n`;

export const MISSING_EXECUTE_PATH_ERROR = `${red(
'▶ No file path provided.'
Expand All @@ -26,7 +26,7 @@ export const RENAME_TABLE_ERROR = (oldTable: string, newTable: string) => {

1. Use "deprecated: true" to deprecate a table before renaming.
2. Use "--force-reset" to ignore this warning and reset the database (deleting all of your data).

Visit https://docs.astro.build/en/guides/astro-db/#renaming-tables to learn more.`
);
};
Expand Down
Loading