Skip to content

Commit

Permalink
Move writePackageJson
Browse files Browse the repository at this point in the history
  • Loading branch information
ChokoJoestar committed May 3, 2023
1 parent f332ecb commit 4ab1ce3
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@ export const createProject = (projectDir: string, sourceDir: string) => {
mkdirSync(`${projectDir}/${sourceDir}`);
};

export const writePackageJson = (
projectDir: string,
projectVerison: string,
projectDescription: string
) => {
const packageJson = `${projectDir}/package.json`;
const packageJsonContent = `
{
"name": "${projectDir.toLowerCase()}",
"description": "${projectDescription}",
"version": "${projectVerison}",
"main": "index.js",
"license": "MIT",
"scripts": {
"start": "node ."
},
"dependencies": {},
"devDependencies": {}
}`;
writeFileSync(packageJson, packageJsonContent);
};

export const initPackageInstaller = (
packageInstaller: string,
projectDir: string
Expand Down Expand Up @@ -34,28 +56,6 @@ export const initTypescript = (
}
};

export const writePackageJson = (
projectDir: string,
projectVerison: string,
projectDescription: string,
) => {
const packageJson = `${projectDir}/package.json`;
const packageJsonContent = `
{
"name": "${projectDir.toLowerCase()}",
"description": "${projectDescription}",
"version": "${projectVerison}",
"main": "index.js",
"license": "MIT",
"scripts": {
"start": "node ."
},
"dependencies": {},
"devDependencies": {}
}`;
writeFileSync(packageJson, packageJsonContent);
};

export const executeShell = (
dir: string,
program: string,
Expand Down

0 comments on commit 4ab1ce3

Please sign in to comment.