Skip to content

Commit c84baa3

Browse files
committed
1 parent e642099 commit c84baa3

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

node_modules/init-package-json/lib/default-input.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,16 +199,17 @@ if (!package.scripts) {
199199

200200
if (!package.repository) {
201201
exports.repository = async () => {
202-
const gconf = await fs.readFile('.git/config', 'utf8').catch(() => '')
202+
const gitConfigPath = path.resolve(dirname, '.git', 'config')
203+
const gconf = await fs.readFile(gitConfigPath, 'utf8').catch(() => '')
203204
const lines = gconf.split(/\r?\n/)
204205

205206
let url
206207
const i = lines.indexOf('[remote "origin"]')
207208

208209
if (i !== -1) {
209-
url = gconf[i + 1]
210+
url = lines[i + 1]
210211
if (!url.match(/^\s*url =/)) {
211-
url = gconf[i + 2]
212+
url = lines[i + 2]
212213
}
213214
if (!url.match(/^\s*url =/)) {
214215
url = null

node_modules/init-package-json/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "init-package-json",
3-
"version": "7.0.1",
3+
"version": "7.0.2",
44
"main": "lib/init-package-json.js",
55
"scripts": {
66
"test": "tap",

package-lock.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
"graceful-fs": "^4.2.11",
109109
"hosted-git-info": "^8.0.2",
110110
"ini": "^5.0.0",
111-
"init-package-json": "^7.0.1",
111+
"init-package-json": "^7.0.2",
112112
"is-cidr": "^5.1.0",
113113
"json-parse-even-better-errors": "^4.0.0",
114114
"libnpmaccess": "^9.0.0",
@@ -7599,9 +7599,9 @@
75997599
}
76007600
},
76017601
"node_modules/init-package-json": {
7602-
"version": "7.0.1",
7603-
"resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-7.0.1.tgz",
7604-
"integrity": "sha512-8KZtk/53ReI2T2f6z2hl5ql6xKLjDexNw7DUqTdR8f+Mo8WZmBjjkH6DrTfBjmW0j3Tqx+j3t8creN0O890+0A==",
7602+
"version": "7.0.2",
7603+
"resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-7.0.2.tgz",
7604+
"integrity": "sha512-Qg6nAQulaOQZjvaSzVLtYRqZmuqOi7gTknqqgdhZy7LV5oO+ppvHWq15tZYzGyxJLTH5BxRTqTa+cPDx2pSD9Q==",
76057605
"inBundle": true,
76067606
"license": "ISC",
76077607
"dependencies": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"graceful-fs": "^4.2.11",
7474
"hosted-git-info": "^8.0.2",
7575
"ini": "^5.0.0",
76-
"init-package-json": "^7.0.1",
76+
"init-package-json": "^7.0.2",
7777
"is-cidr": "^5.1.0",
7878
"json-parse-even-better-errors": "^4.0.0",
7979
"libnpmaccess": "^9.0.0",

0 commit comments

Comments
 (0)