|
|
@ -10,20 +10,8 @@ |
|
|
|
|
|
|
|
header 'Running script.sh...' |
|
|
|
|
|
|
|
modified_cask_files () { |
|
|
|
git diff --name-only --diff-filter=AM "${TRAVIS_COMMIT_RANGE}" -- Casks/*.rb |
|
|
|
} |
|
|
|
|
|
|
|
cask_files_added_outside_casks_dir () { |
|
|
|
git diff --name-only --diff-filter=A "${TRAVIS_COMMIT_RANGE}" -- *.rb |
|
|
|
} |
|
|
|
|
|
|
|
modified_casks=($(modified_cask_files)) |
|
|
|
casks_outside_casks_dir=($(cask_files_added_outside_casks_dir)) |
|
|
|
|
|
|
|
if [[ ${#casks_outside_casks_dir[@]} -gt 0 ]]; then |
|
|
|
odie "Casks added outside Casks directory: ${casks_outside_casks_dir[@]}" |
|
|
|
elif [[ ${#modified_casks[@]} -gt 0 ]]; then |
|
|
|
if any_casks_modified; then |
|
|
|
modified_casks=($(modified_cask_files)) |
|
|
|
run brew cask _audit_modified_casks "${TRAVIS_COMMIT_RANGE}" |
|
|
|
run brew cask style "${modified_casks[@]}" |
|
|
|
else |
|
|
|