Skip to content

Commit

Permalink
Don't use PWD, instead try to use PROJECT_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
djbe committed Apr 9, 2018
1 parent 86ef8e2 commit ce85ba3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Scripts/SwiftLint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/bash

SWIFTLINT="$(PWD)/Pods/SwiftLint/swiftlint"
CONFIG="$(PWD)/.swiftlint.yml"
if [ -z "$PROJECT_DIR" ]; then
pushd "$(dirname $0)/.." > /dev/null
PROJECT_DIR=`pwd`
popd > /dev/null
fi
SWIFTLINT="${PROJECT_DIR}/Pods/SwiftLint/swiftlint"
CONFIG="${PROJECT_DIR}/.swiftlint.yml"

# possible paths
paths_sources="Sources"
Expand All @@ -21,4 +26,4 @@ if [ -z "$selected_path" ]; then
exit 1
fi

"$SWIFTLINT" lint --strict --config "$CONFIG" --path "${PWD}/${selected_path}"
"$SWIFTLINT" lint --strict --config "$CONFIG" --path "${PROJECT_DIR}/${selected_path}"

0 comments on commit ce85ba3

Please sign in to comment.