Add chmod +x to ensure cuckoo_generator can be executed.

This commit is contained in:
Tadeas Kriz 2018-03-26 12:40:53 +02:00
parent ba9b72b061
commit df7138b9f2
2 changed files with 6 additions and 5 deletions

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = "Cuckoo" s.name = "Cuckoo"
s.version = "0.11.0" s.version = "0.11.1"
s.summary = "Cuckoo - first boilerplate-free Swift mocking framework." s.summary = "Cuckoo - first boilerplate-free Swift mocking framework."
s.description = <<-DESC s.description = <<-DESC
Cuckoo is a mocking framework with an easy to use API (inspired by Mockito). Cuckoo is a mocking framework with an easy to use API (inspired by Mockito).
@ -23,8 +23,8 @@ Pod::Spec.new do |s|
s.preserve_paths = ['Generator/**/*', 'run', 'build_generator'] s.preserve_paths = ['Generator/**/*', 'run', 'build_generator']
generator_name = 'cuckoo_generator' generator_name = 'cuckoo_generator'
s.prepare_command = <<-CMD s.prepare_command = <<-CMD
GREP_OPTIONS= curl -Lo #{generator_name} https://github.com/Brightify/Cuckoo/releases/download/#{s.version}/#{generator_name}
curl -Lo #{generator_name} `curl "https://api.github.com/repos/Brightify/Cuckoo/releases/tags/#{s.version}" | grep -oe '"browser_download_url":\s*"[^" ]*"' | grep -oe 'http[^" ]*' | grep #{generator_name} | head -1` chmod +x #{generator_name}
CMD CMD
s.frameworks = 'XCTest', 'Foundation' s.frameworks = 'XCTest', 'Foundation'
s.requires_arc = true s.requires_arc = true

5
run
View File

@ -3,12 +3,13 @@
SCRIPT_PATH="$(dirname "$0")" SCRIPT_PATH="$(dirname "$0")"
FILE_NAME="cuckoo_generator" FILE_NAME="cuckoo_generator"
FILE_PATH="$SCRIPT_PATH/$FILE_NAME" FILE_PATH="$SCRIPT_PATH/$FILE_NAME"
GREP_OPTIONS= GREP_OPTIONS=""
if [[ ! -e "$FILE_PATH" ]]; then if [[ ! -e "$FILE_PATH" ]]; then
echo "No Cuckoo Generator found, downloading latest version..." echo "No Cuckoo Generator found, downloading latest version..."
pushd "$SCRIPT_PATH" pushd "$SCRIPT_PATH"
curl -Lo ${FILE_NAME} `curl "https://api.github.com/repos/Brightify/Cuckoo/releases/latest" | grep -oe '"browser_download_url":\s*"[^" ]*"' | grep -oe 'http[^" ]*' | grep ${FILE_NAME} | head -1` curl -Lo ${FILE_NAME} `curl "https://api.github.com/repos/Brightify/Cuckoo/releases/latest" | grep -oe '"browser_download_url":\s*"[^" ]*"' | grep -oe 'http[^" ]*' | grep ${FILE_NAME} | head -1`
popd chmod +x ${FILE_NAME}
popd
fi fi
INPUT_FILES="" INPUT_FILES=""