-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed start script and create commit to git repo
- Loading branch information
Showing
3 changed files
with
11 additions
and
58 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,13 +47,17 @@ init(dir, initFile, configData, function(_er, data) { | |
); | ||
|
||
(async () => { | ||
git.plugins.set("fs", fs); | ||
await git.init({ dir }); | ||
|
||
await execa("npm", ["install", "typescript", "@types/node", "--save-dev"]); | ||
await execa("tsc", ["--init", "--outDir", "build"]); | ||
await execa("npm", [ | ||
"install", | ||
"prettier", | ||
"pretty-quick", | ||
"husky", | ||
"ts-node", | ||
"--save-dev" | ||
]); | ||
|
||
|
@@ -65,15 +69,18 @@ init(dir, initFile, configData, function(_er, data) { | |
fs.writeFileSync( | ||
dir + "/src/hello-world.ts", | ||
`// happy coding 👻 | ||
console.log("hello world"); | ||
` | ||
console.log("hello world");` | ||
); | ||
|
||
git.plugins.set("fs", fs); | ||
await git.init({ dir }); | ||
await git.add({ dir, filepath: ".gitignore" }); | ||
await git.add({ dir, filepath: "package.json" }); | ||
await git.add({ dir, filepath: "package-lock.json" }); | ||
await git.add({ dir, filepath: "tsconfig.json" }); | ||
await git.add({ dir, filepath: "src/hello-world.ts" }); | ||
await git.commit({ | ||
dir, | ||
message: "Initial Commit 👻", | ||
author: { name: "create-typescript-project", email: "[email protected]" } | ||
}); | ||
})(); | ||
}); |