Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions scripts/preview-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ async function run() {
const ccc = new ColorContrastChecker();
const warnings = [];
const token = core.getInput("token");
console.log("token?");
console.log(token);
const octokit = github.getOctokit(token || process.env.PERSONAL_TOKEN);
const pullRequestId = getPrNumber();

Expand All @@ -108,19 +106,12 @@ async function run() {
const comment = await findComment(octokit, pullRequestId);

const diff = parse(res.data);
const content1 = diff.find((file) => file.to === "themes/index.js")
.chunks[0].changes;

const content = content1
.filter((c) => c.type === "add")
const content = diff
.find((file) => file.to === "themes/index.js")
.chunks[0].changes.filter((c) => c.type === "add")
.map((c) => c.content.replace("+", ""))
.join("");

console.log("content1 diff");
console.log(content1);
console.log("content");
console.log(content);

const themeObject = Hjson.parse(content);
const themeName = Object.keys(themeObject)[0];
const colors = themeObject[themeName];
Expand Down
6 changes: 6 additions & 0 deletions themes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,12 @@ const themes = {
text_color: "e0def4",
bg_color: "191724",
},
testinggg: {
title_color: "9ccfd8",
icon_color: "ebbcba",
text_color: "e0def4",
bg_color: "191724",
},
};

module.exports = themes;