mirror of
https://github.com/Snigdha-OS/Snigdha-OS.github.io.git
synced 2025-09-06 20:55:18 +02:00
$UP: BASE +++
This commit is contained in:
19
scripts/themeUpdate.js
Normal file
19
scripts/themeUpdate.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { exec } = require("child_process");
|
||||
|
||||
const repositoryUrl = "https://github.com/zeon-studio/hugoplate";
|
||||
const localDirectory = "./themes/hugoplate";
|
||||
const foldersToFetch = ["assets", "layouts"];
|
||||
const foldersToSkip = ["exampleSite"];
|
||||
|
||||
const fetchFolder = (folder) => {
|
||||
exec(
|
||||
`curl -L ${repositoryUrl}/tarball/main | tar -xz --strip-components=1 --directory=${localDirectory} --exclude=$(curl -sL ${repositoryUrl}/tarball/main | tar -tz | grep -E "/(${foldersToSkip.join(
|
||||
"|",
|
||||
)})/") */${folder}`,
|
||||
);
|
||||
};
|
||||
|
||||
// Fetch each specified folder
|
||||
foldersToFetch.forEach((folder) => {
|
||||
fetchFolder(folder);
|
||||
});
|
Reference in New Issue
Block a user