This repository has been archived on 2024-11-13. You can view files and clone it, but cannot push or open issues or pull requests.
fediversity.eu/scripts/themeUpdate.js
Valentin Gagarin 72f70ec475 Add 'website/' from commit 'd208ee83f80467e25c662b4680ed2d6161d88d9e'
git-subtree-dir: website
git-subtree-mainline: 83b1c9ac3b58871df715c5993a29d658439fc772
git-subtree-split: d208ee83f80467e25c662b4680ed2d6161d88d9e
2024-10-07 11:53:11 +02:00

20 lines
623 B
JavaScript

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);
});