Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.

Commit 8300024

Browse files
committed
workspace ids
1 parent 5db9d0d commit 8300024

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/commands/org/switch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default class OrgSwitch extends Command {
2828

2929
const res = await readSettingsJson(settingsFilePath);
3030

31-
if (!res.email || !res.apiKey || !res.orgId) {
31+
if (!res.email || !res.apiKey || !res.workspaceId) {
3232
this.log(chalk.red("Not logged in.") + " Log in with `hyp login`.");
3333
return;
3434
}

src/util/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,19 +132,19 @@ export async function getGitRemoteUrl(filePath: string): Promise<string | null>
132132
return remoteMatch[1];
133133
}
134134

135-
export async function readSettingsJson(filePath: string): Promise<{ content: string; email: null | string; installationIds: { [key: string]: string } | null; apiKey: null | string; orgId: null | string }> {
135+
export async function readSettingsJson(filePath: string): Promise<{ content: string; email: null | string; installationIds: { [key: string]: string } | null; apiKey: null | string; workspaceId: null | string }> {
136136
const content = await fs.readFile(filePath, "utf8");
137137

138138
let email: null | string = null;
139139
let apiKey: null | string = null;
140-
let orgId: null | string = null;
140+
let workspaceId: null | string = null;
141141
let installationIds: { [key: string]: string } | null = null;
142142

143143
try {
144144
const jsonContent = JSON.parse(content);
145145
email = jsonContent.HYP_EMAIL || null;
146146
apiKey = jsonContent.HYP_API_KEY || null;
147-
orgId = jsonContent.HYP_ORG_ID || null;
147+
workspaceId = jsonContent.HYP_WORKSPACE_ID || null;
148148
installationIds = jsonContent.INSTALLATION_IDS || null;
149149
} catch {
150150
// ignore error
@@ -155,11 +155,11 @@ export async function readSettingsJson(filePath: string): Promise<{ content: str
155155
email,
156156
installationIds,
157157
apiKey,
158-
orgId,
158+
workspaceId,
159159
};
160160
}
161161

162-
export async function writeToSettingsFile(apiKey: string, email: string, orgId: string): Promise<void> {
162+
export async function writeToSettingsFile(apiKey: string, email: string, workspaceId: string): Promise<void> {
163163
const settingsDir = getSettingsDir();
164164
const settingsFilePath = getSettingsFilePath();
165165

@@ -168,10 +168,10 @@ export async function writeToSettingsFile(apiKey: string, email: string, orgId:
168168
await fs.mkdir(settingsDir, { recursive: true });
169169
}
170170

171-
const newSettingsContent: { HYP_EMAIL: string; HYP_API_KEY: string; HYP_ORG_ID: string; INSTALLATION_IDS: { [key: string]: string } | null } = {
171+
const newSettingsContent: { HYP_EMAIL: string; HYP_API_KEY: string; HYP_WORKSPACE_ID: string; INSTALLATION_IDS: { [key: string]: string } | null } = {
172172
HYP_EMAIL: email,
173173
HYP_API_KEY: apiKey,
174-
HYP_ORG_ID: orgId,
174+
HYP_WORKSPACE_ID: workspaceId,
175175
INSTALLATION_IDS: null,
176176
};
177177

0 commit comments

Comments
 (0)