diff --git a/deploy_new_python_project.sh b/deploy_new_python_project.sh index 5d7839f..a972c8b 100644 --- a/deploy_new_python_project.sh +++ b/deploy_new_python_project.sh @@ -43,6 +43,7 @@ do "--project-name"|"-n") shift PROJECT_NAME="${1}" + shift ;; "--project-codename"|"-p") shift @@ -82,18 +83,18 @@ do done destination_path="${DEPLOYMENT_PATH}/${PROJECT_CODENAME}" -mkdir "${destination_path}" +mkdir -p "${DEPLOYMENT_PATH}" script_path=$(dirname "${0}") cp "${script_path}/skeleton" "${destination_path}" -rfp mv "${destination_path}/project_codename.py" "${destination_path}/${PROJECT_CODENAME}.py" while read -r file do - sed -i "s/__project_codename__/${PROJECT_CODENAME}/g" "${file}" - sed -i "s/__author__/${AUTHOR}/g" "${file}" - sed -i "s/__author_email__/${AUTHOR_EMAIL}/g" "${file}" - sed -i "s/__authoring_date__/${AUTHORING_DATE}/g" "${file}" - sed -i "s/__project_name__/${PROJECT_NAME}/g" "${file}" - sed -i "s/__version__/${VERSION}/g" "${file}" - sed -i "s/__url__/${URL}/g" "${file}" - sed -i "s/__license__/${LICENSE}/g" "${file}" -done <<< "$(ls "${destination_path}/")" \ No newline at end of file + sed -i "s/__project_codename__/${PROJECT_CODENAME}/g" "${file}" + sed -i "s/__author__/${AUTHOR}/g" "${file}" + sed -i "s/__author_email__/${AUTHOR_EMAIL}/g" "${file}" + sed -i "s/__authoring_date__/${AUTHORING_DATE}/g" "${file}" + sed -i "s/__project_name__/${PROJECT_NAME}/g" "${file}" + sed -i "s/__version__/${VERSION}/g" "${file}" + sed -i "s/__url__/${URL}/g" "${file}" + sed -i "s/__license__/${LICENSE}/g" "${file}" +done <<< "$(find "${destination_path}/" -type f)" \ No newline at end of file