I have a shell script that is finding and copying files, which works just fine. However when it tries to find and copy a directory it is not working
#!/bin/sh
PROJECT_NAME=$1
HELM_BUILD_FOLDER="helm-build"
HELM_PROJECT_BUILD_FOLDER="$HELM_BUILD_FOLDER/$PROJECT_NAME
#find and copy all FILES from .helm/my-project to helm-build/my-project/project-values THIS IS SUCCESSFUL
find .helm/$PROJECT_NAME* -maxdepth 0 -type f,d -exec cp -av "{}" $HELM_PROJECT_BUILD_FOLDER/project-values/ ";"
#find and copy all diectories from .helm/my-project to helm-build/my-project THIS IS FAILING even though directories exist
find .helm/$PROJECT_NAME/* -maxdepth 0 -type f -exec cp -av "{}" $HELM_PROJECT_BUILD_FOLDER/ ";"
I have tried several different means of fixing this. I've tried using execdir instead of exec, used cp -R. I tried to simply output the results of the directory find and nothing got output... it's almost as if it's not being ran.
Another weird thing is happening when i try to execute in the terminal. This works, despite $PROJECT_NAME not being defined outside of the script:
find .helm/$PROJECT_NAME/* -maxdepth 0 -type d -exec cp -R -av "{}" helm-build/my-project/ ";"