Only update permissions on copied files.
parent
b74e72d092
commit
c5bceaa1d0
|
@ -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
|
||||
|
|
|
@ -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_NAME>/$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
|
||||
# ============================================================
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {} +
|
||||
|
||||
# ============================================================
|
||||
|
|
Loading…
Reference in New Issue