inflight-cli 2.5.0 → 2.6.0
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/commands/share.js +6 -3
- package/package.json +1 -1
package/dist/commands/share.js
CHANGED
|
@@ -359,18 +359,21 @@ export async function shareCommand(opts = {}) {
|
|
|
359
359
|
const branchMatch = currentBranch
|
|
360
360
|
? projects.find((proj) => proj.latestVersion.branch === currentBranch)
|
|
361
361
|
: undefined;
|
|
362
|
+
// Move branch-matched project to the top of the list
|
|
363
|
+
const sortedProjects = branchMatch
|
|
364
|
+
? [branchMatch, ...projects.filter((proj) => proj.projectId !== branchMatch.projectId)]
|
|
365
|
+
: projects;
|
|
362
366
|
const projectChoice = await scrollableSelect({
|
|
363
367
|
message: "Create a new project in Inflight, or update an existing one?",
|
|
364
368
|
maxItems: 5,
|
|
365
|
-
initialValue: branchMatch?.projectId,
|
|
366
369
|
options: [
|
|
367
370
|
{ value: "new", label: "Start a new project" },
|
|
368
|
-
...
|
|
371
|
+
...sortedProjects.map((proj) => ({
|
|
369
372
|
value: proj.projectId,
|
|
370
373
|
label: `"${proj.latestVersion.title}"`,
|
|
371
374
|
hint: [
|
|
372
375
|
formatRelativeTime(proj.latestVersion.createdAt),
|
|
373
|
-
proj.latestVersion.branch === currentBranch ?
|
|
376
|
+
proj.latestVersion.branch === currentBranch ? `← current branch (${currentBranch})` : "",
|
|
374
377
|
]
|
|
375
378
|
.filter(Boolean)
|
|
376
379
|
.join(" · "),
|