Remove code to auto-detect email/name from git config as it was too installation dependent
This commit is contained in:
parent
a2f8332bac
commit
79528aac64
9
package-lock.json
generated
9
package-lock.json
generated
@ -52,7 +52,6 @@
|
|||||||
"handlebars": "^4.7.9",
|
"handlebars": "^4.7.9",
|
||||||
"highlight.js": "^11.11.1",
|
"highlight.js": "^11.11.1",
|
||||||
"ieee754": "^1.2.1",
|
"ieee754": "^1.2.1",
|
||||||
"iniparser": "^1.0.5",
|
|
||||||
"jimp": "1.6.0",
|
"jimp": "1.6.0",
|
||||||
"jq-web": "^0.5.1",
|
"jq-web": "^0.5.1",
|
||||||
"jquery": "3.7.1",
|
"jquery": "3.7.1",
|
||||||
@ -11524,14 +11523,6 @@
|
|||||||
"node": "^20.17.0 || >=22.9.0"
|
"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": {
|
"node_modules/internal-slot": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz",
|
||||||
|
|||||||
@ -136,7 +136,6 @@
|
|||||||
"handlebars": "^4.7.9",
|
"handlebars": "^4.7.9",
|
||||||
"highlight.js": "^11.11.1",
|
"highlight.js": "^11.11.1",
|
||||||
"ieee754": "^1.2.1",
|
"ieee754": "^1.2.1",
|
||||||
"iniparser": "^1.0.5",
|
|
||||||
"jimp": "1.6.0",
|
"jimp": "1.6.0",
|
||||||
"jq-web": "^0.5.1",
|
"jq-web": "^0.5.1",
|
||||||
"jquery": "3.7.1",
|
"jquery": "3.7.1",
|
||||||
|
|||||||
@ -14,7 +14,6 @@ import process from "process";
|
|||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import EscapeString from "../../operations/EscapeString.mjs";
|
import EscapeString from "../../operations/EscapeString.mjs";
|
||||||
import iniparser from "iniparser";
|
|
||||||
|
|
||||||
|
|
||||||
const dir = path.join(process.cwd() + "/src/core/operations/");
|
const dir = path.join(process.cwd() + "/src/core/operations/");
|
||||||
@ -25,23 +24,6 @@ if (!fs.existsSync(dir)) {
|
|||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
const testDir = path.join(process.cwd() + "/tests/operations/tests/");
|
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 ioTypes = ["string", "byteArray", "number", "html", "ArrayBuffer", "BigNumber", "JSON", "File", "List<File>"];
|
||||||
|
|
||||||
const schema = {
|
const schema = {
|
||||||
@ -106,14 +88,14 @@ If your operation does not rely on a library, just leave this blank and it will
|
|||||||
authorName: {
|
authorName: {
|
||||||
description: "Your name or username will be added to the @author tag for this operation.",
|
description: "Your name or username will be added to the @author tag for this operation.",
|
||||||
example: "n1474335",
|
example: "n1474335",
|
||||||
default: gitUserName,
|
default: "",
|
||||||
prompt: "Username",
|
prompt: "Username",
|
||||||
type: "string"
|
type: "string"
|
||||||
},
|
},
|
||||||
authorEmail: {
|
authorEmail: {
|
||||||
description: "Your email address will also be added to the @author tag for this operation.",
|
description: "Your email address will also be added to the @author tag for this operation.",
|
||||||
example: "n1474335@gmail.com",
|
example: "n1474335@gmail.com",
|
||||||
default: gitUserEmail,
|
default: "",
|
||||||
prompt: "Email",
|
prompt: "Email",
|
||||||
type: "string"
|
type: "string"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user