Skip to content

Commit b632c9e

Browse files
committed
fixed minor bugs
1 parent 9d4476d commit b632c9e

File tree

7 files changed

+33
-7
lines changed

7 files changed

+33
-7
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
.yarn
22
node_modules
3+
coverage
4+
dist
5+
.env
36
.DS_Store
47
.idea
58
.vscode

bin/create-harmonia.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ sCp.stop("Copied files");
7878

7979
const sMustache = p.spinner();
8080

81-
sMustache.start("Filling templates");
81+
sMustache.start("Tweaking things");
8282

8383
const data = { name, org, year: new Date().getFullYear() };
8484

@@ -109,7 +109,11 @@ fs.writeFileSync(
109109
);
110110
fs.rmSync(`${destDir}/LICENSE.template.md`);
111111

112-
sMustache.stop("Filled templates");
112+
execSync(`mv ${destDir}/gitignore ${destDir}/.gitignore`);
113+
execSync(`mv ${destDir}/client/gitignore ${destDir}/client/.gitignore`);
114+
execSync(`mv ${destDir}/server/gitignore ${destDir}/server/.gitignore`);
115+
116+
sMustache.stop("Tweaked things");
113117

114118
const sGit = p.spinner();
115119

bin/postinstall.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Thx https://stackoverflow.com/a/53239387/6612932
2+
3+
import { execSync } from "node:child_process";
4+
5+
const env = process.env;
6+
7+
if (
8+
// if INIT_CWD (yarn/npm install invocation path) and PWD
9+
// are the same, then local (dev) install/add is taking place
10+
env.INIT_CWD === env.PWD ||
11+
// local (dev) yarn install may have been run
12+
// from a project subfolder
13+
env.INIT_CWD.indexOf(env.PWD) === 0
14+
) {
15+
// do post-installation things
16+
execSync("husky install");
17+
}

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-harmonia",
3-
"version": "5.0.0",
3+
"version": "5.0.3",
44
"type": "module",
55
"description": "Our pedagogical framework for the React-Express-MySQL cursus in Wild Code School",
66
"homepage": "https://github.com/wildcodeschool/create-harmonia#readme",
@@ -15,17 +15,19 @@
1515
"create-harmonia": "./bin/create-harmonia.js"
1616
},
1717
"scripts": {
18-
"postinstall": "husky install",
18+
"postinstall": "node ./bin/postinstall",
1919
"lint": "lint-staged"
2020
},
2121
"keywords": [],
2222
"author": "Wild Code School",
2323
"license": "MIT",
24-
"devDependencies": {
24+
"dependencies": {
2525
"@clack/prompts": "^0.7.0",
26-
"husky": "^8.0.3",
2726
"kleur": "^4.1.5",
28-
"lint-staged": "^15.2.0",
2927
"mustache": "^4.2.0"
28+
},
29+
"devDependencies": {
30+
"husky": "^8.0.3",
31+
"lint-staged": "^15.2.0"
3032
}
3133
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)