I'm trying to create a workflow for designing multiple Shopify themes based on the same theme. I have written a simple PowerShell script that collects the necessary files and compresses them into a zip file.
Here is a simplified version of my script:
# Copy all files from the base theme to my temporary folder
Copy-Item $baseTheme"*" $tempFolder -recurse -force -exclude ".git"
# Include the files specific to the current theme
Copy-Item $specificTheme"assets" $tempFolder -recurse -force
Copy-Item $specificTheme"config" $tempFolder -recurse -force
Copy-Item $specificTheme"layout" $tempFolder -recurse -force
Copy-Item $specificTheme"snippets" $tempFolder -recurse -force
Copy-Item $specificTheme"templates" $tempFolder -recurse -force
# Compress the temporary folder
Compress-Archive $tempFolder $zipFileName
When I manually perform these steps, and create the zip file in Windows using Send To > Compressed (zipped) folder
, Shopify is completely happy with the zip file.
However, when I upload the result of this script it gives me the following error:
There was 1 error:
zip does not contain a valid theme: missing template "layout/theme.liquid", missing template "templates/index.liquid", missing template "templates/collection.liquid", missing template "templates/product.liquid", missing template "templates/page.liquid", missing template "templates/cart.liquid", and missing template "templates/blog.liquid"
I've double and triple checked the zip file, and all of the required files exist. I've messed around with the -CompressionLevel
of Compress-Archive. I've tried other methods of zipping folders within PowerShell. All with no luck.
I really can't see any difference between the results of the script and compressing manually. Any ideas?