Skip to content

Commit

Permalink
feat: remove init .gitignore&license action
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenYCL committed Dec 2, 2020
1 parent fa4c2cb commit 78a7305
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 41 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lgoweb/cra",
"version": "1.0.1",
"version": "1.0.2",
"description": "A CLI to bootstrap projects",
"main": "src/index.js",
"bin": {
Expand Down
14 changes: 0 additions & 14 deletions publish.sh

This file was deleted.

52 changes: 26 additions & 26 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@ async function copyTemplateFiles(options) {
});
}

async function createGitignore(options) {
const file = fs.createWriteStream(
path.join(options.targetDirectory, '.gitignore'),
{flags: 'a'}
);
return writeGitignore({
type: 'Node',
file: file,
});
}

async function createLicense(options) {
const targetPath = path.join(options.targetDirectory, 'LICENSE');
const licenseContent = license.licenseText
.replace('<year>', new Date().getFullYear())
.replace('<copyright holders>', `${options.name} (${options.email})`);
return writeFile(targetPath, licenseContent, 'utf8');
}
// async function createGitignore(options) {
// const file = fs.createWriteStream(
// path.join(options.targetDirectory, '.gitignore'),
// {flags: 'a'}
// );
// return writeGitignore({
// type: 'Node',
// file: file,
// });
// }

// async function createLicense(options) {
// const targetPath = path.join(options.targetDirectory, 'LICENSE');
// const licenseContent = license.licenseText
// .replace('<year>', new Date().getFullYear())
// .replace('<copyright holders>', `${options.name} (${options.email})`);
// return writeFile(targetPath, licenseContent, 'utf8');
// }

async function initGit(options) {
const result = await execa('git', ['init'], {
Expand Down Expand Up @@ -157,14 +157,14 @@ export async function createProject(options) {
title: 'Modify config',
task: () => modifyConfig(options)
},
{
title: 'Create gitignore',
task: () => createGitignore(options),
},
{
title: 'Create License',
task: () => createLicense(options),
},
// {
// title: 'Create gitignore',
// task: () => createGitignore(options),
// },
// {
// title: 'Create License',
// task: () => createLicense(options),
// },
{
title: 'Initialize git',
task: () => initGit(options),
Expand Down

0 comments on commit 78a7305

Please sign in to comment.