From df52fd46e5b357503601d0f336c7fccb31b1f68b Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Tue, 14 Mar 2017 10:45:59 -0400 Subject: [PATCH] whitespace stripper for runtime.txt --- bin/steps/python | 4 ++++ vendor/runtime-fixer | 11 +++++++++++ 2 files changed, 15 insertions(+) create mode 100755 vendor/runtime-fixer diff --git a/bin/steps/python b/bin/steps/python index 141ea89..f984d55 100755 --- a/bin/steps/python +++ b/bin/steps/python @@ -1,4 +1,8 @@ set +e + +# Fix any pending whitespace around runtime.txt. +runtime-fixer runtime.txt + PYTHON_VERSION=$(cat runtime.txt) # Install Python. diff --git a/vendor/runtime-fixer b/vendor/runtime-fixer new file mode 100755 index 0000000..4ee1e41 --- /dev/null +++ b/vendor/runtime-fixer @@ -0,0 +1,11 @@ +#!/usr/bin/env python + +import sys + +runtime_file = sys.argv[1] + +with open(req_file, 'r') as f: + r = f.read().strip() + +with open(runtime_file, 'w') as f: + f.write(r)