Skip to content

Commit d611aa5

Browse files
committed
update
1 parent 68e885c commit d611aa5

File tree

6 files changed

+4063
-3352
lines changed

6 files changed

+4063
-3352
lines changed

main.js

+1,309-1,363
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

manual-update.mjs

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import { exec } from "child_process";
33

44
const url = "https://raw.githubusercontent.com/twibiral/obsidian-execute-code/master/src/main.ts";
55
let settingsText = readFileSync("src/Settings.ts", "utf8");
6-
fetch(url).then(r => r.text()).then(text=>{
7-
const languageAliases = /export const languageAliases = \[([\s\S]*?)\]/.exec(text)?.[1]?.replace(/\s*/g,"");
8-
const canonicalLanguages = /export const canonicalLanguages = \[([\s\S]*?)\]/.exec(text)?.[1]?.replace(/\s*/g,"");
9-
writeFileSync("src/Settings.ts",settingsText.replace(/const EXECUTE_CODE_LANGUAGE_ALIASES: Array<string> = \[([\s\S]*?)\]/,`const EXECUTE_CODE_LANGUAGE_ALIASES: Array<string> = [${languageAliases}]`).replace(/const EXECUTE_CODE_CANONICAL_LANGUAGES: Array<string> = \[([\s\S]*?)\]/,`const EXECUTE_CODE_CANONICAL_LANGUAGES: Array<string> = [${canonicalLanguages}]`));
6+
fetch(url).then(r => r.text()).then(text =>
7+
{
8+
const languageAliases = /export const languageAliases = \[([\s\S]*?)\]/.exec(text)?.[1]?.replace(/\s*/g, "");
9+
const canonicalLanguages = /export const canonicalLanguages = \[([\s\S]*?)\]/.exec(text)?.[1]?.replace(/\s*/g, "");
10+
writeFileSync("src/Settings.ts", settingsText.replace(/const EXECUTE_CODE_LANGUAGE_ALIASES: Array<string> = \[([\s\S]*?)\]/, `const EXECUTE_CODE_LANGUAGE_ALIASES: Array<string> = [${languageAliases}]`).replace(/const EXECUTE_CODE_CANONICAL_LANGUAGES: Array<string> = \[([\s\S]*?)\]/, `const EXECUTE_CODE_CANONICAL_LANGUAGES: Array<string> = [${canonicalLanguages}]`));
1011
});
1112

12-
exec("git fetch execute-code && git show execute-code/master:src/CodeBlockArgs.ts > src/External/ExecuteCode/CodeBlockArgs.ts && eslint --fix src/External/ExecuteCode/CodeBlockArgs.ts",(error)=>console.log(error));
13+
exec("git fetch execute-code && git show execute-code/master:src/CodeBlockArgs.ts > src/External/ExecuteCode/CodeBlockArgs.ts && eslint --fix src/External/ExecuteCode/CodeBlockArgs.ts", (error) => console.log(error));

0 commit comments

Comments
 (0)