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

feat: prompt for git #596

Merged
merged 6 commits into from
Sep 1, 2020
Merged

feat: prompt for git #596

merged 6 commits into from
Sep 1, 2020

Conversation

lloydtao
Copy link
Contributor

@lloydtao lloydtao commented Aug 30, 2020

Feat - Prompt for Git

Issue #587 - Creating a project within an existing repository causes a fatal git error

Description

This pull request will prompt the user to choose a version control system.

image

There's two main reasons for this:

  1. Using npx create-nuxt-app in an existing repository fails, as two .git directories exist. This is especially prevalent in our projects where we have a Django backend and Nuxt frontend in the same repo.
  2. Several types of VCS exist (e.g. SVN), and users shouldn't be forced to delete unwanted directories in order to implement their preference.

This feature has been designed to easily allow another VCS to be added to the list.

Changes

The prompt.js asks for a VCS preference in the form of a list.

image

The saofile.js will now only run gitInit() if the respective choice is selected.

image

@lloydtao
Copy link
Contributor Author

Tests pass on my machine 😣

image

@lloydtao
Copy link
Contributor Author

Re-linting directly before pushing did the trick. Life of a Windows dev 😁

@lloydtao
Copy link
Contributor Author

I'm now realising that these tests are auto-generated 😂

@lloydtao
Copy link
Contributor Author

All good to review now 😜

{ name: 'None', value: 'none' },
{ name: 'Git', value: 'git' }
],
default: 'none'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be better to keep default as git like before? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pi0 sure! my reasoning here was that the other fields use default: 'none', so it was an attempt to match those design patterns, but i understand why Git is a good exception 😼

the prompt now uses git as default, as well as putting that option at the top of the list

@lloydtao lloydtao requested a review from pi0 August 31, 2020 16:03
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks ❤️

@lloydtao
Copy link
Contributor Author

lloydtao commented Sep 2, 2020

thank you. this was my first open source contribution to a mainstream repo, so cheers for the good experience 😼

@lloydtao lloydtao deleted the feat/prompt-for-git branch September 2, 2020 14:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants