Skip to content

Commit 8904bf8

Browse files
committedMar 6, 2024
style(cli): fix getProjectId() formatting
I did this in a separate commit from the previous one, in order to make the `git diff` easier to read for reviewers.
1 parent 3363295 commit 8904bf8

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed
 

‎packages/cli/src/commander.ts

+28-28
Original file line numberDiff line numberDiff line change
@@ -167,37 +167,37 @@ function linkCmd() {
167167

168168
// Ask the user which project they want to upload each diagram to
169169
const getProjectId: LinkOptions['getProjectId'] = async (cache, documentTitle) => {
170-
if (cache.previousSelectedProjectId !== undefined) {
171-
if (cache.usePreviousSelectedProjectId === undefined) {
172-
cache.usePreviousSelectedProjectId = confirm({
173-
message: `Would you like to upload all diagrams to this project?`,
174-
default: true,
175-
});
176-
}
177-
if (await cache.usePreviousSelectedProjectId) {
178-
return cache.previousSelectedProjectId;
179-
}
180-
}
181-
182-
cache.projects = cache.projects ?? client.getProjects();
183-
const projectId = await select({
184-
message: `Select a project to upload ${documentTitle} to`,
185-
choices: [
186-
...(await cache.projects).map((project) => {
187-
return {
188-
name: project.title,
189-
value: project.id,
190-
};
191-
}),
192-
new Separator(
193-
`Or go to ${new URL('/app/projects', client.baseURL)} to create a new project`,
194-
),
195-
],
170+
if (cache.previousSelectedProjectId !== undefined) {
171+
if (cache.usePreviousSelectedProjectId === undefined) {
172+
cache.usePreviousSelectedProjectId = confirm({
173+
message: `Would you like to upload all diagrams to this project?`,
174+
default: true,
196175
});
176+
}
177+
if (await cache.usePreviousSelectedProjectId) {
178+
return cache.previousSelectedProjectId;
179+
}
180+
}
181+
182+
cache.projects = cache.projects ?? client.getProjects();
183+
const projectId = await select({
184+
message: `Select a project to upload ${documentTitle} to`,
185+
choices: [
186+
...(await cache.projects).map((project) => {
187+
return {
188+
name: project.title,
189+
value: project.id,
190+
};
191+
}),
192+
new Separator(
193+
`Or go to ${new URL('/app/projects', client.baseURL)} to create a new project`,
194+
),
195+
],
196+
});
197197

198-
cache.previousSelectedProjectId = projectId;
198+
cache.previousSelectedProjectId = projectId;
199199

200-
return projectId;
200+
return projectId;
201201
};
202202

203203
const linkCache = {};

0 commit comments

Comments
 (0)
Failed to load comments.