mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-08 21:07:46 +00:00
This is a follow-up to #8091 which: - Makes `vc project` the default command, with `vc projects` aliased to `vc project` (previously it was not clear in the code which one was the "real" command) - Makes some helper names for `ls` more specific ### 📋 Checklist <!-- Please keep your PR as a Draft until the checklist is complete --> #### Tests - [ ] The code changed/added as part of this PR has been covered with tests - [ ] All tests pass locally with `yarn test-unit` #### Code Review - [ ] This PR has a concise title and thorough description useful to a reviewer - [ ] Issue from task tracker has a link to this PR
20 lines
463 B
TypeScript
20 lines
463 B
TypeScript
export function pluckIdentifiersFromDeploymentList(output: string): {
|
|
project: string | undefined;
|
|
org: string | undefined;
|
|
} {
|
|
const project = output.match(/(?<=Deployments for )(.*)(?= under)/);
|
|
const org = output.match(/(?<=under )(.*)(?= \[)/);
|
|
|
|
return {
|
|
project: project?.[0],
|
|
org: org?.[0],
|
|
};
|
|
}
|
|
|
|
export function parseSpacedTableRow(output: string): string[] {
|
|
return output
|
|
.trim()
|
|
.replace(/ {1} +/g, ',')
|
|
.split(',');
|
|
}
|