From 31c0f2c93ab94155aba8548fe2b0e12a8ff0db56 Mon Sep 17 00:00:00 2001 From: Vlad Date: Sun, 17 Jan 2021 21:37:27 +0300 Subject: [PATCH] refactor: @petropavel13 comments --- .githooks/prepare-commit-msg | 6 +++--- README.md | 4 ++-- setup | 7 +++++++ setup.sh | 21 --------------------- 4 files changed, 12 insertions(+), 26 deletions(-) create mode 100755 setup delete mode 100755 setup.sh diff --git a/.githooks/prepare-commit-msg b/.githooks/prepare-commit-msg index 3b321632..dcac0b12 100755 --- a/.githooks/prepare-commit-msg +++ b/.githooks/prepare-commit-msg @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -import sys, re +import sys, re, os from subprocess import check_output from sys import getdefaultencoding @@ -75,10 +75,10 @@ def lint_commit_message(fh, commit_msg): if is_valid_commit or is_merge_commit: print_result_header(success_title, success_color) write_commit_message(fh, commit_msg) - sys.exit(0) + sys.exit(os.EX_OK) else: print_error_message() - sys.exit(1) + sys.exit(os.EX_DATAERR) def run_script(): commit_msg_filepath = sys.argv[1] diff --git a/README.md b/README.md index f29471c1..0eb30062 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ This repository contains the following additional frameworks: ## Setup Run following script in framework's folder: -```ruby -./setup.sh +```sh +./setup ``` ## Installation diff --git a/setup b/setup new file mode 100755 index 00000000..97d7cd9d --- /dev/null +++ b/setup @@ -0,0 +1,7 @@ +# Find source dir +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +cd "$DIR" + +# Configure githooks folder path +git config core.hooksPath .githooks \ No newline at end of file diff --git a/setup.sh b/setup.sh deleted file mode 100755 index 8fd1b630..00000000 --- a/setup.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -# Configure githooks folder path -git config core.hooksPath .githooks - -# Carthage - -xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX) -trap 'rm -f "$xcconfig"' INT TERM HUP EXIT - -# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise -# the build will fail on lipo due to duplicate architectures. - -CURRENT_XCODE_VERSION=$(xcodebuild -version | grep "Build version" | cut -d' ' -f3) -echo "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$CURRENT_XCODE_VERSION = arm64 arm64e armv7 armv7s armv6 armv8" >> $xcconfig - -echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$(XCODE_PRODUCT_BUILD_VERSION))' >> $xcconfig -echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig - -export XCODE_XCCONFIG_FILE="$xcconfig" -carthage bootstrap --platform iOS --cache-builds \ No newline at end of file