Remove code to auto-detect email/name from git config as it was too installation dependent

This commit is contained in:
GCHQDeveloper581 2026-05-30 10:54:02 +00:00
parent a2f8332bac
commit 79528aac64
No known key found for this signature in database
GPG Key ID: 6222E059A3DF595C
3 changed files with 2 additions and 30 deletions

9
package-lock.json generated
View File

@ -52,7 +52,6 @@
"handlebars": "^4.7.9",
"highlight.js": "^11.11.1",
"ieee754": "^1.2.1",
"iniparser": "^1.0.5",
"jimp": "1.6.0",
"jq-web": "^0.5.1",
"jquery": "3.7.1",
@ -11524,14 +11523,6 @@
"node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/iniparser": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/iniparser/-/iniparser-1.0.5.tgz",
"integrity": "sha512-i40MWqgTU6h/70NtMsDVVDLjDYWwcIR1yIEVDPfxZIJno9z9L4s83p/V7vAu2i48Vj0gpByrkGFub7ko9XvPrw==",
"engines": {
"node": "*"
}
},
"node_modules/internal-slot": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz",

View File

@ -136,7 +136,6 @@
"handlebars": "^4.7.9",
"highlight.js": "^11.11.1",
"ieee754": "^1.2.1",
"iniparser": "^1.0.5",
"jimp": "1.6.0",
"jq-web": "^0.5.1",
"jquery": "3.7.1",

View File

@ -14,7 +14,6 @@ import process from "process";
import fs from "fs";
import path from "path";
import EscapeString from "../../operations/EscapeString.mjs";
import iniparser from "iniparser";
const dir = path.join(process.cwd() + "/src/core/operations/");
@ -25,23 +24,6 @@ if (!fs.existsSync(dir)) {
process.exit(1);
}
const testDir = path.join(process.cwd() + "/tests/operations/tests/");
const configFile = "/.gitconfig";
let gitUserEmail, gitUserName;
// gitconfig in root is better than global one
let gitConfig = process.cwd() + "/.git/config";
if (!fs.existsSync(gitConfig)) {
gitConfig = process.env.HOME + configFile;
}
// get user settings from git
if (fs.existsSync(gitConfig)) {
const config = iniparser.parseSync(gitConfig);
if ("user" in config) {
if ("email" in config.user) gitUserEmail = config.user.email;
if ("name" in config.user) gitUserName = config.user.name;
}
}
const ioTypes = ["string", "byteArray", "number", "html", "ArrayBuffer", "BigNumber", "JSON", "File", "List<File>"];
const schema = {
@ -106,14 +88,14 @@ If your operation does not rely on a library, just leave this blank and it will
authorName: {
description: "Your name or username will be added to the @author tag for this operation.",
example: "n1474335",
default: gitUserName,
default: "",
prompt: "Username",
type: "string"
},
authorEmail: {
description: "Your email address will also be added to the @author tag for this operation.",
example: "n1474335@gmail.com",
default: gitUserEmail,
default: "",
prompt: "Email",
type: "string"
}