From 79528aac64c6e86054bce1990402eed47e45bb10 Mon Sep 17 00:00:00 2001 From: GCHQDeveloper581 <63102987+GCHQDeveloper581@users.noreply.github.com> Date: Sat, 30 May 2026 10:54:02 +0000 Subject: [PATCH] Remove code to auto-detect email/name from git config as it was too installation dependent --- package-lock.json | 9 --------- package.json | 1 - src/core/config/scripts/newOperation.mjs | 22 ++-------------------- 3 files changed, 2 insertions(+), 30 deletions(-) diff --git a/package-lock.json b/package-lock.json index d6d9c969..89e5b3ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/package.json b/package.json index 0f54dc2f..d7d1b48a 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/core/config/scripts/newOperation.mjs b/src/core/config/scripts/newOperation.mjs index a3576779..59c93b88 100644 --- a/src/core/config/scripts/newOperation.mjs +++ b/src/core/config/scripts/newOperation.mjs @@ -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"]; 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" }