Skip to content

GitSpace v2 Command: create #19

@davfive

Description

@davfive

Requirement

USAGE
gitspaces create [--num/-n NUM_SPACES] REPO-URL [... REPO-URL-N] [DIRECTORY]

WHERE
DIRECTORY             Project directory. Defaults to first repo name.
REPO-URL-N            https or ssh url for git repo(s)

--num/-n NUM_SPACES   Number of project spaces to create. Default is 3

$ gitspaces create git@github.com:davfive/gitspaces
1.  IF NOT IN ProjectPath directory; provide promptui.Select list to choose from
2. Show promptui.Prompt to specify directory, default is DIRECTORY, if provided
    input validator: X if directory already exists in ProjectPath
3. Show promptui.Prompt for initial space name, no default
4. cd into space directory when complete.

❔ What to do if project creation fails after initial project directory was created? (repo doesn't exist, ...)

Details

  1. If it is a a single repo GitSpaces project, create the multi-repo space layout

    • turns project-A/space-*/<repo-1-top-level-here>
      into project-A/space-*/<repo-name>/<top-level-here>
    • go to step 2
  2. If there are already multiple repos in the space, just add it at the top level

    • adds project-A/space-*/repo-N/...

Pending Decisions

  • How to know if space is single or multi? (just check for top-level .git - if yes, then single level?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions