diff --git a/specs/clang/runner b/specs/clang/runner index 3ae669e..6a56b1c 100755 --- a/specs/clang/runner +++ b/specs/clang/runner @@ -42,7 +42,7 @@ trap cleanup EXIT # Copy template contents over to the intermediate build directory. cp -r template/* "$BUILD" -# Explicitly set permissions on all the new files. +# Explicitly set permissions on all copied files. find "$BUILD" -type f -execdir chmod 644 {} + find "$BUILD" -type d -execdir chmod 755 {} + chmod 755 "$BUILD"/.githooks/pre-commit diff --git a/specs/mix/runner b/specs/mix/runner index e52de38..4317a97 100755 --- a/specs/mix/runner +++ b/specs/mix/runner @@ -42,25 +42,27 @@ trap cleanup EXIT # Copy template contents over to the intermediate build directory. cp -r template/* "$BUILD" +# Explicitly set permissions on all copied files. +find "$BUILD" -type f -execdir chmod 644 {} + +find "$BUILD" -type d -execdir chmod 755 {} + + # Generate a new project with the specified name using `mix`. Generate in a -# subdirectory to avoid interaction and potential overwriting of files. +# subdirectory to avoid interactive conflict resolution. nix develop "$BUILD" --command bash -c "mix new $BUILD/project --app '$APP'" -# Copy the generated files into the intermediate build directory. Also overwrite -# the generated README in favor of that defined in our template. +# Copy the generated files into the intermediate build directory. mv -f "$BUILD"/project/* "$BUILD" rmdir "$BUILD"/project + +# Overwrite the generated README in favor of that defined in our template. cp template/README.md "$BUILD" +chmod 644 "$BUILD"/README.md # Replace the template name found in the flake.nix file. The mix generator would # fail if $APP did not consist of just lowercase ASCII letters, numbers, or # underscores. Thus $APP is safe to interpolate into the following command. sed -i "s//$APP/g" "$BUILD/flake.nix" -# Explicitly set permissions on all the new files. -find "$BUILD" -type f -execdir chmod 644 {} + -find "$BUILD" -type d -execdir chmod 755 {} + - # ============================================================ # EPILOGUE # ============================================================ diff --git a/specs/poetry/runner b/specs/poetry/runner index 4531d60..cc0191c 100755 --- a/specs/poetry/runner +++ b/specs/poetry/runner @@ -42,7 +42,7 @@ trap cleanup EXIT # Copy template contents over to the intermediate build directory. cp -r template/* "$BUILD" -# Explicitly set permissions on all the new files. +# Explicitly set permissions on all copied files. find "$BUILD" -type f -execdir chmod 644 {} + find "$BUILD" -type d -execdir chmod 755 {} + chmod 755 "$BUILD"/.githooks/pre-commit diff --git a/specs/postgres/runner b/specs/postgres/runner index 7aa9253..b68eb88 100755 --- a/specs/postgres/runner +++ b/specs/postgres/runner @@ -42,7 +42,7 @@ trap cleanup EXIT # Copy template contents over to the intermediate build directory. cp -r template/* "$BUILD" -# Explicitly set permissions on all the new files. +# Explicitly set permissions on all copied files. find "$BUILD" -type f -execdir chmod 644 {} + # ============================================================