@thisismanta/semantic-version 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/install-git-hooks.js +9 -1
- package/package.json +2 -3
package/lib/install-git-hooks.js
CHANGED
|
@@ -25,9 +25,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const fs = __importStar(require("fs/promises"));
|
|
27
27
|
const fp = __importStar(require("path"));
|
|
28
|
+
const execa_1 = require("execa");
|
|
28
29
|
main();
|
|
29
30
|
async function main() {
|
|
30
|
-
|
|
31
|
+
let workingPath = process.cwd();
|
|
32
|
+
if (fp.basename(fp.dirname(workingPath)) !== 'node_modules') {
|
|
33
|
+
console.log('Do nothing when running this on semantic-version repository.');
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
workingPath = fp.resolve(workingPath, '../..');
|
|
37
|
+
const huskyDirectoryPath = fp.resolve(workingPath, '.husky');
|
|
38
|
+
await (0, execa_1.execaCommand)('npx husky install');
|
|
31
39
|
await upsert(fp.join(huskyDirectoryPath, 'commit-msg'), 'npx lint-commit-message ${1}');
|
|
32
40
|
await upsert(fp.join(huskyDirectoryPath, 'post-commit'), 'npx auto-npm-version');
|
|
33
41
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thisismanta/semantic-version",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"author": "Anantachai Saothong <thisismanta@gmail.com>",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"engines": {
|
|
@@ -22,8 +22,7 @@
|
|
|
22
22
|
"preversion": "npm run test && npm run build && git add lib/*",
|
|
23
23
|
"version": "npm publish --access public",
|
|
24
24
|
"postversion": "git push --tags origin master",
|
|
25
|
-
"postinstall": "
|
|
26
|
-
"prepare": "husky uninstall && rm -rf .husky"
|
|
25
|
+
"postinstall": "node ./lib/install-git-hooks.js"
|
|
27
26
|
},
|
|
28
27
|
"devDependencies": {
|
|
29
28
|
"@types/jest": "^29.4.0",
|