I have this script:
#!/bin/bash
date="20180313"
source_path="/Users/<user_name>/Source/Git/WSI"
installer_path="../FE_Installer/cdk_installer/*"
echo "archive=$source_path/wsi_installers_$date.zip"
echo "path=$installer_path"
# Create the installer archive
zip -r "$source_path/wsi_installers_$date.zip" "$installer_path"
If the archive does not exist, it fails with:
zip warning: name not matched: ../FE_Installer/cdk_installer/*
zip error: Nothing to do! (try: zip -r /Users/<user_name>/Source/Git/WSI/wsi_installers_20180313.zip . -i ../FE_Installer/cdk_installer/*)
Though the echo statements indicate a correct path:
archive=/Users/<user_name>/Source/Git/WSI/wsi_installers_20180313.zip
path=../FE_Installer/cdk_installer/*
I tried the recommended command (using the -i option) but it fails with:
zip warning: zip file empty
If I use the output from the echo statements and run the zip command manually:
zip -r /Users/<user_name>/Source/Git/WSI/wsi_installers_20180313.zip ../FE_Installer/cdk_installer/*
It works:
adding: ../FE_Installer/cdk_installer/ADP_Installers.hta (deflated 71%)
adding: ../FE_Installer/cdk_installer/StartHta.exe (deflated 71%)
adding: ../FE_Installer/cdk_installer/WSPCP_TDI/ (stored 0%)
...
adding: ../FE_Installer/cdk_installer/common/styles/plugins.css (deflated 85%)
adding: ../FE_Installer/cdk_installer/common/styles/table.css (deflated 80%)
adding: ../FE_Installer/cdk_installer/updatecenter/ (stored 0%)
Then when I run the script, it also works, with the output showing it is updating the archive:
updating: ../FE_Installer/cdk_installer/ADP_Installers.hta (deflated 71%)
updating: ../FE_Installer/cdk_installer/StartHta.exe (deflated 71%)
updating: ../FE_Installer/cdk_installer/WSPCP_TDI/ (stored 0%)
...
updating: ../FE_Installer/cdk_installer/common/styles/plugins.css (deflated 85%)
updating: ../FE_Installer/cdk_installer/common/styles/table.css (deflated 80%)
updating: ../FE_Installer/cdk_installer/updatecenter/ (stored 0%)
What am I missing?
set -xto your script. That'll show what it thinks is happening.*ininstaller_pathisn't getting expanded.