Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@cloudcannon/configuration-loader": "0.0.10",
"@cloudcannon/configuration-types": "0.0.58",
"@cloudcannon/gadget": "0.0.33",
"@cloudcannon/sdk": "0.0.9",
"@cloudcannon/sdk": "0.0.10",
"ajv": "8.20.0",
"chokidar": "^4.0.3",
"citty": "0.2.2",
Expand Down
6 changes: 4 additions & 2 deletions src/sdk-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import CloudCannonClient, {
type CloudCannonClientConfig,
type UserAccessKey,
} from '@cloudcannon/sdk';
import pkg from '../package.json' with { type: 'json' };
import { printErrorJson, text } from './configure/utility.ts';

function getWindowsDataDir(): string | undefined {
Expand Down Expand Up @@ -157,11 +158,12 @@ export async function getSdkClient(): Promise<CloudCannonClient> {
}
}
const apiKey = process.env.CLOUDCANNON_API_KEY;
const client = `cli/${pkg.version}`;
let options: CloudCannonClientConfig;
if (userAccessKey) {
options = { userAccessKey: userAccessKey };
options = { userAccessKey: userAccessKey, client };
} else if (apiKey) {
options = { key: apiKey };
options = { key: apiKey, client };
} else {
console.log(
`You must log in to run this command. Either run ${text.em('cloudcannon login')} to authorise with your CloudCannon account, or provide an API key through the CLOUDCANNON_API_KEY environment variable.`
Expand Down