update hugo config services and added theme-update script

This commit is contained in:
somrat sorkar
2024-01-08 11:42:36 +06:00
parent aa00fbb343
commit c0d75b264b
12 changed files with 54 additions and 21 deletions

19
scripts/themeUpdate.js Normal file
View 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);
});