Skip to content

Commit

Permalink
Merge pull request VoxaAI#143 from wuelcas/fix-issue-with-gitignore-w…
Browse files Browse the repository at this point in the history
…hen-generating-a-new-project

Fix issue with gitignore when generating a new project
  • Loading branch information
wuelcas committed Mar 31, 2020
2 parents 0b41152 + d741422 commit e4e87ce
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.3.1] - 2020-03-31

### Fixed

- Fixed issue with missing .gitignore file when generating a new project

## [2.3.0] - 2020-03-27

### Added
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "voxa-cli",
"version": "2.3.0",
"version": "2.3.1",
"description": "The Voxa CLI tools",
"bin": {
"voxa": "./bin/voxa.js"
Expand Down
8 changes: 6 additions & 2 deletions src/VoxaGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ export default class VoxaGenerator {
}

private async copyGitIgnoreFile() {
return this.generateHandlebarTemplateFile(".gitignore")
await this.copyFileOrFolder("gitignore.txt");
return fs.rename(
path.join(process.cwd(), this.data.folderName, "gitignore.txt"),
path.join(process.cwd(), this.data.folderName, ".gitignore")
);
}

private copyInteractionFile() {
Expand Down Expand Up @@ -226,7 +230,7 @@ export default class VoxaGenerator {
"package.json",
"src",
"interaction.json",
".gitignore",
"gitignore.txt",
`server.${this.data.ext}`,
"web"
];
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions test/createJavascript.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ describe("Javascript project generator", () => {
expect(pathExists).to.be.true;
});

it("should have a .gitignore file", async () => {
const filePath = getFilePath("my-skill", ".gitignore");
const pathExists = await fs.pathExists(filePath);
expect(pathExists).to.be.true;
});

it("should have a README file with the name of the skill", async () => {
const filePath = getFilePath("my-skill", "README.md");
const pathExists = await fs.pathExists(filePath);
Expand Down
6 changes: 6 additions & 0 deletions test/createTypescript.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ describe("Typescript project generator", () => {
expect(pathExists).to.be.true;
});

it("should have a .gitignore file", async () => {
const filePath = getFilePath("my-skill", ".gitignore");
const pathExists = await fs.pathExists(filePath);
expect(pathExists).to.be.true;
});

it("should have a README file with the name of the skill", async () => {
const filePath = getFilePath("my-skill", "README.md");
const pathExists = await fs.pathExists(filePath);
Expand Down

0 comments on commit e4e87ce

Please sign in to comment.