From e58c7ba3b422ceaa14dfaee7796aaf8f8aa58d05 Mon Sep 17 00:00:00 2001 From: Gary Verhaegen Date: Wed, 21 Jul 2021 11:20:33 +0200 Subject: [PATCH] fix template dot-files (#10342) The `cp $SRC/$d/*` does not copy dot files. CHANGELOG_BEGIN CHANGELOG_END --- templates/BUILD.bazel | 13 ++++++++----- templates/NO_AUTO_COPYRIGHT | 0 .../{default-dlint-yaml => default-dlint.yaml} | 0 3 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 templates/NO_AUTO_COPYRIGHT rename templates/{default-dlint-yaml => default-dlint.yaml} (100%) diff --git a/templates/BUILD.bazel b/templates/BUILD.bazel index 6f820ab37495..57277425d1fc 100644 --- a/templates/BUILD.bazel +++ b/templates/BUILD.bazel @@ -43,7 +43,7 @@ genrule( [ "default-gitattributes", "default-gitignore", - "default-dlint-yaml", + "default-dlint.yaml", "skeleton/**", "empty-skeleton/**", "create-daml-app/**", @@ -68,10 +68,13 @@ genrule( for d in skeleton empty-skeleton create-daml-app quickstart-scala quickstart-java; do mkdir -p $$OUT/$$d cp -rL $$SRC/$$d/* $$OUT/$$d/ - # use default .gitignore and .dlint.yaml if they don't exist in the template - cp -n $$SRC/default-gitattributes $$OUT/$$d/.gitattributes - cp -n $$SRC/default-gitignore $$OUT/$$d/.gitignore - cp -n $$SRC/default-dlint-yaml $$OUT/$$d/.dlint.yaml + for f in gitattributes gitignore dlint.yaml; do + if [ -f "$$SRC/$$d/.$$f" ]; then + cp "$$SRC/$$d/.$$f" "$$OUT/$$d/.$$f" + else + cp "$$SRC/default-$$f" "$$OUT/$$d/.$$f" + fi + done # We avoid introducing infix syntax in the GSG so we disable # the lint there. if [ "$$d" = "create-daml-app" ]; then diff --git a/templates/NO_AUTO_COPYRIGHT b/templates/NO_AUTO_COPYRIGHT new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/templates/default-dlint-yaml b/templates/default-dlint.yaml similarity index 100% rename from templates/default-dlint-yaml rename to templates/default-dlint.yaml