I'm trying to write a Makefile script that zips a directory's contents. Then renames the zip file e.g. public_html.zip to test-1.0.zip. But uncompressing unzip maintained the first zips names.
So far I have
plugin=test
directory=public_html
version=0.0.1
all:
@ echo "Build archive for plugin ${plugin} version=${version}"
@ rm -f ${directory}.zip && zip -rj ${directory}.zip ./*
@ rm -f ${plugin}-${version}.zip && mv ${directory}.zip ${plugin}-${version}.zip
However, renaming on my mac or using the mv commmand and then unzipping or uncompressing gives me the new name test-1.0 rather than public_html.
I know that git archive --prefix allows you to give a different name for paths. I looked into zip -j & --junk-path, but they don't seem to solve it.
I couldn't find any other questions that asked this specifically. The others just wanted to rename the folder and didn't care about keeping the original zip name.