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

Fix #173 - add gitignore to wollok init #175

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions examples/init-examples/existing-folder/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# Local history
.history

# Wollok Log
*.log
11 changes: 11 additions & 0 deletions src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ export default function ({ project, name, noTest = false, noCI = false, game = f
logger.info('Creating README')
writeFileSync(join(project, 'README.md'), readme(exampleName))

logger.info('Creating Gitignore')
writeFileSync(join(project, '.gitignore'), gitignore)

// Finish
logger.info(green('✨ Project succesfully created. Happy coding!'))
}
Expand Down Expand Up @@ -147,4 +150,12 @@ const readme = (exampleName: string) => `

TODO

`

const gitignore = `
# Local history
.history

# Wollok Log
*.log
`
3 changes: 3 additions & 0 deletions test/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ describe('testing init', () => {
expect(existsSync(join(project, 'package.json'))).to.be.true
expect(existsSync(join(project, GITHUB_FOLDER, 'ci.yml'))).to.be.true
expect(existsSync(join(project, 'README.md'))).to.be.true
expect(existsSync(join(project, '.gitignore'))).to.be.true
expect(existsSync(join(project, 'mainExample.wpgm'))).to.be.false
expect(getResourceFolder()).to.be.undefined

Expand All @@ -64,6 +65,7 @@ describe('testing init', () => {
expect(existsSync(join(project, 'mainPepita.wpgm'))).to.be.true
expect(existsSync(join(project, 'package.json'))).to.be.true
expect(existsSync(join(project, GITHUB_FOLDER, 'ci.yml'))).to.be.true
expect(existsSync(join(project, '.gitignore'))).to.be.true
expect(existsSync(join(project, 'README.md'))).to.be.true
expect(getResourceFolder()).to.be.equal('assets')
})
Expand All @@ -81,6 +83,7 @@ describe('testing init', () => {
expect(existsSync(join(project, 'package.json'))).to.be.true
expect(existsSync(join(project, 'mainPepita.wpgm'))).to.be.false
expect(existsSync(join(project, GITHUB_FOLDER, 'ci.yml'))).to.be.false
expect(existsSync(join(project, '.gitignore'))).to.be.true
expect(existsSync(join(project, 'README.md'))).to.be.true
})

Expand Down
Loading