Skip to content

Commit

Permalink
add all hbs files from root to the template (#21)
Browse files Browse the repository at this point in the history
The theme.zip file didn't include `custom-support.hbs`. This updates the
script to include all .hbs files, so the packaging script won't need to
be updated for each new file in the future.
  • Loading branch information
indirect authored Jan 5, 2024
1 parent aa13f5f commit 5187c8d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions utils/zip.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
Use this script to create a zip file of your theme. Add or remove files you want to include.
*/
const fs = require('fs');
const AdmZip = require('adm-zip');

const zip = new AdmZip();
Expand All @@ -10,12 +11,11 @@ zip.addLocalFolder('./assets', 'assets');
zip.addLocalFolder('./partials', 'partials');

// Files
zip.addLocalFile('./author.hbs');
zip.addLocalFile('./default.hbs');
// zip.addLocalFile('./error-404.hbs');
zip.addLocalFile('./home.hbs');
zip.addLocalFile('./index.hbs');
fs.readdirSync('./')
.filter((file) => file.endsWith('.hbs'))
.forEach((file) => zip.addLocalFile(`./${file}`));

zip.addLocalFile('./package.json');
zip.addLocalFile('./post.hbs');
zip.addLocalFile('./README.md');

zip.writeZip('./dist/theme.zip');

0 comments on commit 5187c8d

Please sign in to comment.