mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-06-06 04:35:20 +00:00
Fix glob sync after updating to version 9
This commit is contained in:
parent
9b9e4b9ac9
commit
be33faaba3
@ -2,14 +2,14 @@ require("dotenv").config();
|
||||
const axios = require("axios");
|
||||
const fs = require("fs");
|
||||
const crypto = require("crypto");
|
||||
const glob = require("glob");
|
||||
const {globSync} = require("glob");
|
||||
|
||||
module.exports = async () => {
|
||||
let baseUrl = process.env.SITE_BASE_URL || "";
|
||||
if (baseUrl && !baseUrl.startsWith("http")) {
|
||||
baseUrl = "https://" + baseUrl;
|
||||
}
|
||||
let themeStyle = glob.sync("src/site/styles/_theme.*.css")[0] || "";
|
||||
let themeStyle = globSync("src/site/styles/_theme.*.css")[0] || "";
|
||||
if (themeStyle) {
|
||||
themeStyle = themeStyle.split("site")[1];
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ require("dotenv").config();
|
||||
const axios = require("axios");
|
||||
const fs = require("fs");
|
||||
const crypto = require("crypto");
|
||||
const glob = require("glob");
|
||||
const {globSync} = require("glob");
|
||||
|
||||
const themeCommentRegex = /\/\*[\s\S]*?\*\//g;
|
||||
|
||||
@ -23,7 +23,7 @@ async function getTheme() {
|
||||
|
||||
const res = await axios.get(themeUrl);
|
||||
try {
|
||||
const existing = glob.sync("src/site/styles/_theme.*.css");
|
||||
const existing = globSync("src/site/styles/_theme.*.css");
|
||||
existing.forEach((file) => {
|
||||
fs.rmSync(file);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user