Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed Dec 2, 2024
1 parent e642099 commit c84baa3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
7 changes: 4 additions & 3 deletions node_modules/init-package-json/lib/default-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,17 @@ if (!package.scripts) {

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

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

if (i !== -1) {
url = gconf[i + 1]
url = lines[i + 1]
if (!url.match(/^\s*url =/)) {
url = gconf[i + 2]
url = lines[i + 2]
}
if (!url.match(/^\s*url =/)) {
url = null
Expand Down
2 changes: 1 addition & 1 deletion node_modules/init-package-json/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "init-package-json",
"version": "7.0.1",
"version": "7.0.2",
"main": "lib/init-package-json.js",
"scripts": {
"test": "tap",
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
"graceful-fs": "^4.2.11",
"hosted-git-info": "^8.0.2",
"ini": "^5.0.0",
"init-package-json": "^7.0.1",
"init-package-json": "^7.0.2",
"is-cidr": "^5.1.0",
"json-parse-even-better-errors": "^4.0.0",
"libnpmaccess": "^9.0.0",
Expand Down Expand Up @@ -7599,9 +7599,9 @@
}
},
"node_modules/init-package-json": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-7.0.1.tgz",
"integrity": "sha512-8KZtk/53ReI2T2f6z2hl5ql6xKLjDexNw7DUqTdR8f+Mo8WZmBjjkH6DrTfBjmW0j3Tqx+j3t8creN0O890+0A==",
"version": "7.0.2",
"resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-7.0.2.tgz",
"integrity": "sha512-Qg6nAQulaOQZjvaSzVLtYRqZmuqOi7gTknqqgdhZy7LV5oO+ppvHWq15tZYzGyxJLTH5BxRTqTa+cPDx2pSD9Q==",
"inBundle": true,
"license": "ISC",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"graceful-fs": "^4.2.11",
"hosted-git-info": "^8.0.2",
"ini": "^5.0.0",
"init-package-json": "^7.0.1",
"init-package-json": "^7.0.2",
"is-cidr": "^5.1.0",
"json-parse-even-better-errors": "^4.0.0",
"libnpmaccess": "^9.0.0",
Expand Down

0 comments on commit c84baa3

Please sign in to comment.