From f7535eb99204e2c691aa6b330e5672caa29a29c0 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Sun, 22 Apr 2018 01:34:42 -0600 Subject: [PATCH 1/2] Add circle ci status badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d478ded..ac1ee8b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # [![Join the chat at https://gitter.im/ethereum/](https://badges.gitter.im/ethereum/.svg)](https://gitter.im/ethereum/?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![Build Status](https://travis-ci.org/ethereum/.png)](https://travis-ci.org/ethereum/) +[![Build Status](https://circleci.com/gh/ethereum/.svg?style=shield)](https://circleci.com/gh/ethereum/) [![PyPI version](https://badge.fury.io/py/.svg)](https://badge.fury.io/py/) [![Python versions](https://img.shields.io/pypi/pyversions/.svg)](https://pypi.python.org/pypi/) [![Docs build](https://readthedocs.org/projects//badge/?version=latest)](http://.readthedocs.io/en/latest/?badge=latest) From cdc83bd498d3e145109a760314d41ea3504f821f Mon Sep 17 00:00:00 2001 From: David Sanders Date: Sun, 22 Apr 2018 01:35:08 -0600 Subject: [PATCH 2/2] Make find replace script more macOS friendly Also, make handling of arbitrary filenames a bit more robust. --- fill_template_vars.sh | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/fill_template_vars.sh b/fill_template_vars.sh index 17f2503..531efcf 100755 --- a/fill_template_vars.sh +++ b/fill_template_vars.sh @@ -4,9 +4,6 @@ set -o errexit set -o nounset set -o pipefail -# List of all non-executable files -TEMPLATE_FILES=$(find . ! -perm -u=x -type f | grep -v "\.git") - echo "What is your python module name?" read MODULE_NAME @@ -29,12 +26,20 @@ PROJECT_NAME=${PROJECT_INPUT:-$REPO_NAME} echo "What is a one-liner describing the project?" read SHORT_DESCRIPTION -sed -i "s//$MODULE_NAME/g" $TEMPLATE_FILES -sed -i "s//$PYPI_NAME/g" $TEMPLATE_FILES -sed -i "s//$REPO_NAME/g" $TEMPLATE_FILES -sed -i "s//$RTD_NAME/g" $TEMPLATE_FILES -sed -i "s//$PROJECT_NAME/g" $TEMPLATE_FILES -sed -i "s//$SHORT_DESCRIPTION/g" $TEMPLATE_FILES +_replace() { + local find_cmd=(find . ! -perm -u=x ! -path '*/.git/*' -type f) + + if [[ $(uname) == Darwin ]]; then + "${find_cmd[@]}" -exec sed -i '' "$1" {} + + else + "${find_cmd[@]}" -exec sed -i "$1" {} + + fi +} +_replace "s//$PYPI_NAME/g" +_replace "s//$REPO_NAME/g" +_replace "s//$RTD_NAME/g" +_replace "s//$PROJECT_NAME/g" +_replace "s//$SHORT_DESCRIPTION/g" mkdir $MODULE_NAME touch $MODULE_NAME/__init__.py