mirror of
https://github.com/10h30/astroplate.git
synced 2026-06-05 15:08:00 +09:00
update scripts
This commit is contained in:
@@ -10,10 +10,6 @@ const path = require("path");
|
||||
];
|
||||
|
||||
const configFiles = [
|
||||
{
|
||||
filePath: "tailwind.config.js",
|
||||
patterns: ["darkmode:\\s*{[^}]*},", 'darkMode:\\s*"class",'],
|
||||
},
|
||||
{ filePath: "src/config/theme.json", patterns: ["colors.darkmode"] },
|
||||
];
|
||||
|
||||
@@ -71,13 +67,9 @@ const path = require("path");
|
||||
|
||||
function removeDarkMode(configFile) {
|
||||
const { filePath, patterns } = configFile;
|
||||
if (filePath === "tailwind.config.js") {
|
||||
removeDarkModeFromFiles(filePath, patterns);
|
||||
} else {
|
||||
const contentFile = JSON.parse(fs.readFileSync(filePath, "utf8"));
|
||||
patterns.forEach((pattern) => deleteNestedProperty(contentFile, pattern));
|
||||
fs.writeFileSync(filePath, JSON.stringify(contentFile));
|
||||
}
|
||||
const contentFile = JSON.parse(fs.readFileSync(filePath, "utf8"));
|
||||
patterns.forEach((pattern) => deleteNestedProperty(contentFile, pattern));
|
||||
fs.writeFileSync(filePath, JSON.stringify(contentFile));
|
||||
}
|
||||
|
||||
function deleteNestedProperty(obj, propertyPath) {
|
||||
|
||||
Reference in New Issue
Block a user