Unverified Commit 51734a3b authored by Chun Fan's avatar Chun Fan Committed by GitHub
Browse files

Merge pull request #81 from NordicSemiconductor/fix/patch-on-unix2

Fix patch on unix
parents 3e27f949 b4911350
......@@ -110,6 +110,20 @@ function sdk_exists () {
# Patch the downloaded SDK in order to compile the connectivity application
function sdk_patch () {
# Detect which OS is running
UNAME="$(uname)"
# If OS is Linux or Darwin
# Change the format of line ending to unix
if [[ "${UNAME}" == "Linux" ]]; then
echo "> Modifying SDK line ending format..."
find $DL_LOCATION/$SDK_NAME/ -type f -exec sed -i $'s/\r//' {} \;
fi
if [[ "${UNAME}" == "Darwin" ]]; then
echo "> Modifying SDK line ending format..."
LC_CTYPE=C
find $DL_LOCATION/$SDK_NAME/ -type f -exec sed -i '' $'s/\r//' {} \;
fi
echo "> Applying SDK patch '${PATCH_FILE}'..."
# Apply the patch from the base nRF SDK folder (remove the first portion of the path)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment