fixed this
[jprojects-scripts.git] / cp-dist.sh
index ace7597..74cf417 100755 (executable)
@@ -3,16 +3,25 @@
 . ./.jprojects.sh || exit 255
 
 for project in ${LIST}; do
-       if [ -f "${project}/dist.sh" ]
+       if [ "${project}" = "jprojects-scripts" ]
        then
-               echo "$0: Copying dist.sh to '${project}' ..."
-               cp -v dist.sh "${project}/" || exit 255
+               echo "$0: Skipping jprojects-scripts ..."
+               continue
+       elif [ -f "${JPROJECTS_HOME}/${project}/dist.sh" ]
+       then
+               echo "$0: Copying dist.sh/.git* to '${project}' ..."
+               cp -v dist.sh "${JPROJECTS_HOME}/${project}/" || exit 255
+               cp -vu "${JPROJECTS_HOME}/jprojects-scripts/.gitattributes" "${JPROJECTS_HOME}/${project}"
+               cp -vu "${JPROJECTS_HOME}/jprojects-scripts/.gitignore" "${JPROJECTS_HOME}/${project}"
        fi
 
-       if [ ! -d "${project}/docs" -o "$1" = "f" ]
+       if [ -d "${JPROJECTS_HOME}/${project}" -a ! -d "${JPROJECTS_HOME}/${project}/docs" -o "$1" = "f" ]
        then
                echo "$0: GNU-ifying project '${project}' ..."
-               cp -rv docs "${project}/" || exit 255
+               mkdir --parent "${JPROJECTS_HOME}/${project}/docs" || exit 255
+               cp -rpv ${JPROJECTS_HOME}/jprojects-scripts/docs/* "${JPROJECTS_HOME}/${project}/docs/" || exit 255
+               cp -vu "${JPROJECTS_HOME}/jprojects-scripts/.gitignore" "${JPROJECTS_HOME}/${project}"
+               cp -vu "${JPROJECTS_HOME}/jprojects-scripts/.gitattributes" "${JPROJECTS_HOME}/${project}"
                cd "${JPROJECTS_HOME}/${project}"
                echo "$0: git add ..."
                git add docs || exit 255