Skip to content

Commit

Permalink
fixed minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
rocambille committed Jan 19, 2024
1 parent f7b8585 commit f0e9a6e
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.yarn
node_modules
coverage
dist
.env
.DS_Store
.idea
.vscode
8 changes: 6 additions & 2 deletions bin/create-harmonia.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ sCp.stop("Copied files");

const sMustache = p.spinner();

sMustache.start("Filling templates");
sMustache.start("Tweaking things");

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

Expand Down Expand Up @@ -109,7 +109,11 @@ fs.writeFileSync(
);
fs.rmSync(`${destDir}/LICENSE.template.md`);

sMustache.stop("Filled templates");
execSync(`mv ${destDir}/gitignore ${destDir}/.gitignore`);
execSync(`mv ${destDir}/client/gitignore ${destDir}/client/.gitignore`);
execSync(`mv ${destDir}/server/gitignore ${destDir}/server/.gitignore`);

sMustache.stop("Tweaked things");

const sGit = p.spinner();

Expand Down
17 changes: 17 additions & 0 deletions bin/postinstall.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Thx https://stackoverflow.com/a/53239387/6612932

import { execSync } from "node:child_process";

const env = process.env;

if (
// if INIT_CWD (yarn/npm install invocation path) and PWD
// are the same, then local (dev) install/add is taking place
env.INIT_CWD === env.PWD ||
// local (dev) yarn install may have been run
// from a project subfolder
env.INIT_CWD.indexOf(env.PWD) === 0
) {
// do post-installation things
execSync("husky install");
}
4 changes: 2 additions & 2 deletions package-lock.json

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

12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-harmonia",
"version": "5.0.0",
"version": "5.0.3",
"type": "module",
"description": "Our pedagogical framework for the React-Express-MySQL cursus in Wild Code School",
"homepage": "https://github.com/wildcodeschool/create-harmonia#readme",
Expand All @@ -15,17 +15,19 @@
"create-harmonia": "./bin/create-harmonia.js"
},
"scripts": {
"postinstall": "husky install",
"postinstall": "node ./bin/postinstall",
"lint": "lint-staged"
},
"keywords": [],
"author": "Wild Code School",
"license": "MIT",
"devDependencies": {
"dependencies": {
"@clack/prompts": "^0.7.0",
"husky": "^8.0.3",
"kleur": "^4.1.5",
"lint-staged": "^15.2.0",
"mustache": "^4.2.0"
},
"devDependencies": {
"husky": "^8.0.3",
"lint-staged": "^15.2.0"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f0e9a6e

Please sign in to comment.