@polygontech/commit-template 1.0.1 → 1.1.0

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/CZRCLoader.js CHANGED
@@ -57,7 +57,7 @@ CZRCLoader.prototype.overwriteFromProject = async function () {
57
57
  };
58
58
 
59
59
  CZRCLoader.prototype.loadFromProjectURL = async function () {
60
- let urlFile = process.cwd() + "/" + project_rc_url_file_name;
60
+ let urlFile = getProjectFolder() + "/" + project_rc_url_file_name;
61
61
 
62
62
  if (!fs.existsSync(urlFile)) return;
63
63
 
@@ -65,7 +65,7 @@ CZRCLoader.prototype.loadFromProjectURL = async function () {
65
65
  };
66
66
 
67
67
  CZRCLoader.prototype.loadFromProjectRC = function () {
68
- let project_rc_file_fqn = process.cwd() + "/" + project_rc_file_name;
68
+ let project_rc_file_fqn = getProjectFolder() + "/" + project_rc_file_name;
69
69
 
70
70
  if (!fs.existsSync(project_rc_file_fqn)) return;
71
71
 
@@ -113,4 +113,15 @@ function getProjectRCDownloadFileFQN() {
113
113
  return rc_folder_name + "/" + process.cwd().replace("/", "").replaceAll("/", "_").replaceAll("-", "_") + ".json";
114
114
  }
115
115
 
116
+ function getProjectFolder() {
117
+ let current = process.cwd();
118
+
119
+ while (current.length > 1) {
120
+ if (fs.existsSync(current + '/.git')) break;
121
+ current = current.split("/").slice(0, -1).join("/");
122
+ }
123
+
124
+ return current;
125
+ }
126
+
116
127
  module.exports = CZRCLoader;
package/README.md CHANGED
@@ -3,4 +3,4 @@ JS wrapper for the [commit template](https://github.com/ShafiqIslam/dotfiles/blo
3
3
 
4
4
  # usage
5
5
  Not for open use. Meant to be used with
6
- [@sheba/cz-convention](https://github.com/ShafiqIslam/cz-convention) and [@sheba/commitlint](https://github.com/ShafiqIslam/commitlint)
6
+ [@polygontech/cz-convention](https://github.com/ShafiqIslam/cz-convention) and [@polygontech/commitlint](https://github.com/ShafiqIslam/commitlint)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polygontech/commit-template",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "JS wrapper of https://github.com/ShafiqIslam/dotfiles/blob/master/git/.gitmessage.",
5
5
  "homepage": "https://github.com/ShafiqIslam/commit-template",
6
6
  "main": "index.js",
@@ -8,6 +8,9 @@
8
8
  "type": "git",
9
9
  "url": "https://github.com/ShafiqIslam/commit-template.git"
10
10
  },
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
11
14
  "author": "Shafiqul Islam <islamshafiq003@gmail.com>",
12
15
  "license": "MIT",
13
16
  "dependencies": {