Skip to content

Commit

Permalink
Merge pull request #8 from cytopia/fix-trailing-space
Browse files Browse the repository at this point in the history
Fix #7: Ensure CRLF is not falsy treated as trailing whitespace
  • Loading branch information
cytopia authored Dec 8, 2018
2 parents f27904d + 892d6ea commit 2efa58a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
[![Docker image](https://images.microbadger.com/badges/image/cytopia/awesome-ci.svg)](https://hub.docker.com/r/cytopia/awesome-ci)
[![License](https://poser.pugx.org/cytopia/awesome-ci/license)](http://opensource.org/licenses/MIT)

[![Docker image](http://dockeri.co/image/cytopia/awesome-ci)](https://hub.docker.com/r/cytopia/awesome-ci)

**Runs on**

[![Linux](https://raw.githubusercontent.com/cytopia/icons/master/64x64/linux.png)](https://www.kernel.org/)
Expand Down Expand Up @@ -212,7 +214,7 @@ will also have to mount that into the container:
```bash
docker run \
-v /host/path/to/awesome-ci.conf:/etc/awesome-ci.conf \
-v ${PWD}:/ac cytopia/awesome-ci file-crlf --path=/ac --config=/etc/awesome-ci.conf
-v ${PWD}:/ac cytopia/awesome-ci file-crlf --path=/ac --config=/etc/awesome-ci.conf
```

## Documentation
Expand Down
6 changes: 3 additions & 3 deletions bin/file-trailing-space
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ DEFAULT_CUST_OPS=""
# __CUSTOM_OPT_PLACEHOLDER__
# This will be replaced either with custom options
# or with the default options.
MY_REG="^.*[[:space:]]+$"
MY_REG="^.*[[:blank:]]+$"
MY_CHECK="LC_ALL=C grep --color=always -inHE \"${MY_REG}\" \"\$1\" || true"

# Can this check fix the problems?
ENABLE_FIX=1

# Command for fixing
MY_FIX_CMD="grep --color=always -iqE \"${MY_REG}\" \"\$1\" && (sed -i\"\" \"s/[[:space:]]*\$//\" \"\$1\" && echo \"Fixing: \$1\" || echo \"FAILED: \$1\") || true"
MY_FIX_CMD="grep --color=always -iqE \"${MY_REG}\" \"\$1\" && (sed -i\"\" \"s/[[:blank:]]*\$//\" \"\$1\" && echo \"Fixing: \$1\" || echo \"FAILED: \$1\") || true"

# Command to be displayed for --info
MY_INFO="grep -V | grep -E '([0-9]+\.+)+'"
Expand Down Expand Up @@ -603,7 +603,7 @@ if [ "${MY_CFG}" != "" ]; then
if ! check_config_file "${MY_CFG}"; then
exit 1
fi

# shellcheck disable=SC1090
. "${MY_CFG}"
fi

Expand Down

0 comments on commit 2efa58a

Please sign in to comment.