From 5553153edaa814134314471d5931f9e04427812f Mon Sep 17 00:00:00 2001 From: Wuelber Castillo Date: Tue, 31 Mar 2020 15:58:43 -0600 Subject: [PATCH 1/3] Generate gitignore file from a txt file --- src/VoxaGenerator.ts | 8 ++++++-- templates/javascript/{.gitignore => gitignore.txt} | 0 templates/typescript/{.gitignore => gitignore.txt} | 0 3 files changed, 6 insertions(+), 2 deletions(-) rename templates/javascript/{.gitignore => gitignore.txt} (100%) rename templates/typescript/{.gitignore => gitignore.txt} (100%) diff --git a/src/VoxaGenerator.ts b/src/VoxaGenerator.ts index b17e741..bcf6c97 100644 --- a/src/VoxaGenerator.ts +++ b/src/VoxaGenerator.ts @@ -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() { @@ -226,7 +230,7 @@ export default class VoxaGenerator { "package.json", "src", "interaction.json", - ".gitignore", + "gitignore.txt", `server.${this.data.ext}`, "web" ]; diff --git a/templates/javascript/.gitignore b/templates/javascript/gitignore.txt similarity index 100% rename from templates/javascript/.gitignore rename to templates/javascript/gitignore.txt diff --git a/templates/typescript/.gitignore b/templates/typescript/gitignore.txt similarity index 100% rename from templates/typescript/.gitignore rename to templates/typescript/gitignore.txt From d9c3c117048d6275f801872d810036dc5f21ab51 Mon Sep 17 00:00:00 2001 From: Wuelber Castillo Date: Tue, 31 Mar 2020 16:03:21 -0600 Subject: [PATCH 2/3] Create test cases to check gitignore file --- test/createJavascript.spec.ts | 6 ++++++ test/createTypescript.spec.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/test/createJavascript.spec.ts b/test/createJavascript.spec.ts index 5284ab0..e87dbb7 100644 --- a/test/createJavascript.spec.ts +++ b/test/createJavascript.spec.ts @@ -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); diff --git a/test/createTypescript.spec.ts b/test/createTypescript.spec.ts index 072ffd0..4a1b6d7 100644 --- a/test/createTypescript.spec.ts +++ b/test/createTypescript.spec.ts @@ -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); From d7414229199923573373674079e24d9572e80e4d Mon Sep 17 00:00:00 2001 From: Wuelber Castillo Date: Tue, 31 Mar 2020 16:17:00 -0600 Subject: [PATCH 3/3] Update voxa-cli version --- CHANGELOG.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8a2039..f9aeee8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/package.json b/package.json index 21bb829..a4474c3 100644 --- a/package.json +++ b/package.json @@ -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"