Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init :: Initialize git repo and new flag --noGit #192

Merged
merged 4 commits into from
Oct 8, 2024

Conversation

nmigueles
Copy link
Contributor

@nmigueles nmigueles commented Sep 29, 2024

New option for init command that initializes a git repository in the freshly created project

If you want to opt out you can pass the --noGit or -ng option.

Usage example:

wollok init # initializes a git repo
wollok init --noGit # skips the git repo creation

This option runs the git init command.

Something that i didn't test is what happens if the user does not have git installed locally. Tested and handled

Fixes #122

@nmigueles nmigueles changed the title Init :: Initialize git repo with --git flag Init :: Initialize git repo and new flag --noGit Oct 5, 2024
@nmigueles
Copy link
Contributor Author

@fdodino actualizado teniendo en cuenta lo que hablamos el miercoles!

Copy link
Contributor

@fdodino fdodino left a comment

Choose a reason for hiding this comment

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

Fenómeno! Te dejé una sugerencia pava de agregarle un iconito.
Por mí sale con fritas, @PalumboN @ivojawer hablamos el miércoles pasado sobre

  • cambiarle el shortcut para que no se repita con el de game
  • usar noGit para cambiar la opción por defecto que es sí utilizar git
  • la opción de que vos pases el repo y te lo clone me parece que tenemos que iterarla, porque no me queda claro qué agregaría a lo que ya te da el git clone, o bueno, pushearlo de una puede ser pero para una v2

src/commands/init.ts Outdated Show resolved Hide resolved
@@ -61,6 +61,7 @@ program.command('init')
.option('-g, --game', 'adds a game program to the project', false)
.option('-t, --noTest', 'avoids creating a test file', false)
.option('-c, --noCI', 'avoids creating a file for CI', false)
.option('-ng, --noGit', 'avoids initializing a git repository', false)
Copy link
Contributor

Choose a reason for hiding this comment

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

🏅

@@ -47,6 +48,8 @@ describe('testing init', () => {
expect(join(project, 'README.md')).to.pathExists
expect(join(project, '.gitignore')).to.pathExists
expect(join(project, 'mainExample.wpgm')).to.pathExists
expect(join(project, '.git')).to.pathExists
Copy link
Contributor

Choose a reason for hiding this comment

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

bien ahí chequeando el directorio en los tests!

Comment on lines +114 to +115
expect(join(project, '.git')).not.to.pathExists
expect(join(project, '.git/HEAD')).not.to.pathExists
Copy link
Contributor

Choose a reason for hiding this comment

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

👏🏼 👏🏼 👏🏼

Co-authored-by: Fernando Dodino <fernando.dodino@gmail.com>
Copy link
Contributor

@ivojawer ivojawer left a comment

Choose a reason for hiding this comment

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

Buenisimo! 💎

Copy link
Contributor

@PalumboN PalumboN left a comment

Choose a reason for hiding this comment

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

Grande @nmigueles ! 🥇 ⚡ :octocat:

@PalumboN
Copy link
Contributor

PalumboN commented Oct 8, 2024

la opción de que vos pases el repo y te lo clone me parece que tenemos que iterarla, porque no me queda claro qué agregaría a lo que ya te da el git clone

Yo entendía que esa opción era para linkear un proyecto nuevo a un repo remoto vacío (algo que no era fácil de hacer en Xtext, siempre recomendábamos usar un template).
En ese caso debería hacer el init + remote add+commit inicial`.

Pero lo dejamos para otra iteración, mergiemos esto 😄

@fdodino fdodino merged commit c57c36c into uqbar-project:master Oct 8, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dar la opcion de inicializar un repo en el comando init
4 participants