Skip to content

Commit

Permalink
fixed start script and create commit to git repo
Browse files Browse the repository at this point in the history
  • Loading branch information
claasahl committed Feb 4, 2019
1 parent 743d4aa commit b4b30eb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 58 deletions.
53 changes: 0 additions & 53 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"node-fetch": "^2.3.0",
"prettier": "^1.16.3",
"pretty-quick": "^1.10.0",
"ts-node": "^8.0.2",
"typescript": "^3.3.1"
}
}
15 changes: 11 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]);

Expand All @@ -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]" }
});
})();
});

0 comments on commit b4b30eb

Please sign in to comment.