From aa94678d06787fac4e88639ca71c26d91b1f1822 Mon Sep 17 00:00:00 2001 From: Claudia Date: Tue, 25 Apr 2017 03:48:44 +0200 Subject: [PATCH] Automate search-replace steps in recipe (#31) This commit tries to leverage the (macOS flavor of) `find` and `sed` to automate steps 5.1.1 and 5.1.2. of the recipe, ultimately merging both into a single step of 5.1. Hopefully, this saves template maintainers a bit of time when executing those recipe steps and is less tedious. It also loses the dependency on the text editor. --- Recipe.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Recipe.md b/Recipe.md index a6b81fa..d042983 100644 --- a/Recipe.md +++ b/Recipe.md @@ -265,11 +265,14 @@ Complete all these instructions on the same calendar day. 5. Remove identifying parts of your project - 1. Use Atom text editor to find and replace all occurrences of these strings (NEED A MORE PORTABLE INSTRUCTION FOR THIS) + 1. Use Terminal.app to find and replace all occurrences of hard-coded strings with template variables - 1. Replace occurrences of "Created by XXX on YYY." with "Created by `__AUTHOR NAME__` on `__TODAYS_DATE__`." + find -E ~/Desktop/__PROJECT_NAME__ \ + -regex '.*\.(h|swift)' -exec sed -i '' -E -e ' + s-(// +Created by ).*( on ).*\.-\1__AUTHOR NAME__\2__TODAYS_DATE__.- + s-(// +Copyright © ).*-\1__TODAYS_YEAR__ __ORGANIZATION NAME__. All rights reserved.-' \ + '{}' \; - 2. Replace occurrences of "Copyright © 2017" with "Copyright © `__TODAYS_YEAR__`" 6. Use Terminal.app to add additional files to the project