diff --git a/cli/src/common.ts b/cli/src/common.ts index 9487d22029..83d3b5d9e0 100644 --- a/cli/src/common.ts +++ b/cli/src/common.ts @@ -369,7 +369,10 @@ export function getNpmClient(config: Config, npmClient: string): Promise export async function copyTemplate(src: string, dst: string) { await copyAsync(src, dst); + await renameGitignore(dst); +} +export async function renameGitignore(dst: string) { // npm renames .gitignore to something else, so our templates // have .gitignore as gitignore, we need to rename it here. const gitignorePath = join(dst, 'gitignore'); diff --git a/cli/src/tasks/new-plugin.ts b/cli/src/tasks/new-plugin.ts index 6f9a22e4c2..7c0629ae6f 100644 --- a/cli/src/tasks/new-plugin.ts +++ b/cli/src/tasks/new-plugin.ts @@ -1,5 +1,5 @@ import { Config } from '../config'; -import { log, logFatal, logInfo, logWarn, runCommand, runTask, writePrettyJSON } from '../common'; +import { log, logFatal, logInfo, logWarn, renameGitignore, runCommand, runTask, writePrettyJSON } from '../common'; import { OS } from '../definitions'; import { emoji } from '../util/emoji'; import { existsAsync, mkdirAsync, readFileAsync, writeFileAsync } from '../util/fs'; @@ -107,6 +107,7 @@ export async function newPlugin(config: Config) { await runTask('Adding plugin files', async () => { await copy(config.plugins.assets.templateDir, pluginPath); + await renameGitignore(pluginPath); await createTSPlugin(config, pluginPath, domain, className, answers); await createIosPlugin(config, pluginPath, domain, className, answers); await createAndroidPlugin(config, pluginPath, domain, className); diff --git a/plugin-template/.gitignore b/plugin-template/gitignore similarity index 87% rename from plugin-template/.gitignore rename to plugin-template/gitignore index f629a7a461..cad8757084 100644 --- a/plugin-template/.gitignore +++ b/plugin-template/gitignore @@ -1,3 +1,7 @@ +# NPM renames .gitignore to .npmignore +# In order to prevent that, we remove the initial "." +# And the CLI then renames it + # node files dist/ node_modules/