diff --git a/.travis.yml b/.travis.yml index 84381bc..de85e1d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,22 +26,20 @@ before_install: - sudo apt-get update -qq # Install - - sudo apt-get install -qq ruby2.1 ruby-switch shellcheck moreutils php5 dos2unix + - sudo apt-get install -qq ruby2.3 ruby2.3-dev ruby-switch shellcheck moreutils php5 dos2unix # Set ruby version - - sudo ruby-switch --set ruby2.1 + #- sudo ruby-switch --set ruby2.3 + - sudo gem update bundler + - sudo gem pristine executable-hooks --version 1.3.2 + - sudo gem pristine gem-wrappers --version 1.3.2 + - sudo gem pristine nokogiri --version 1.8.1 + #- sudo gem pristine ffi --version 1.9.23 # Create custom source/bin directory - sudo mkdir -p /usr/local/bin - sudo mkdir -p /usr/local/src - # symlink alternative node binary - #- sudo ln -s "$(which nodejs)" /usr/local/bin/node - - #- sudo apt-get install -qq shellcheck moreutils nodejs npm php5 - #- sudo ln -s /usr/bin/nodejs /usr/bin/node - #- sudo apt-get install -qq - # NodeJS4 - VERSION="$( curl -Lq https://nodejs.org 2>/dev/null | grep LTS | grep -Eo 'data-version.*.' | grep -oE 'v[0-9.]+' )" - sudo wget -P /usr/local/src https://nodejs.org/dist/${VERSION}/node-${VERSION}-linux-x64.tar.xz @@ -49,17 +47,16 @@ before_install: - sudo ln -s /usr/local/src/node-${VERSION}-linux-x64 /usr/local/node; - sudo ln -s /usr/local/node/bin/* /usr/local/bin/ - - sudo npm install -g eslint - sudo npm install -g jsonlint - #- sudo npm install -g mdlint - sudo gem install scss_lint - - sudo gem install mdl + #- sudo gem install mdl + # + - sudo gem install mdl -v 0.3.1 # Symlink node binaries - sudo ln -s /usr/local/node/bin/* /usr/local/bin/ 2>/dev/null || true - # Install scripts - ./configure - sudo make install @@ -98,7 +95,7 @@ script: - bin/syntax-css --info - bin/syntax-js --info - bin/syntax-json --info - - bin/syntax-markdown --info + #- bin/syntax-markdown --info - bin/syntax-perl --info - bin/syntax-php --info - bin/syntax-python --info @@ -129,7 +126,7 @@ script: - bin/syntax-css --path=. --config=etc/awesome-ci.conf --dry - bin/syntax-js --path=. --config=etc/awesome-ci.conf --dry - bin/syntax-json --path=. --config=etc/awesome-ci.conf --dry - - bin/syntax-markdown --path=. --config=etc/awesome-ci.conf --dry + #- bin/syntax-markdown --path=. --config=etc/awesome-ci.conf --dry - bin/syntax-perl --path=. --config=etc/awesome-ci.conf --dry - bin/syntax-php --path=. --config=etc/awesome-ci.conf --dry - bin/syntax-python --path=. --config=etc/awesome-ci.conf --dry @@ -210,9 +207,9 @@ script: - bin/syntax-json --path=test/ok/ --config=etc/awesome-ci.conf --ignore=".git/,*.pyc,test/,configure.in" --verbose - bin/syntax-json --path=test/ok/ --config=etc/awesome-ci.conf --ignore=".git/,*.pyc,test/,configure.in" - - bin/syntax-markdown --path=test/ok/ --config=etc/awesome-ci.conf --ignore=".git/,*.pyc,test/,configure.in" --list - - bin/syntax-markdown --path=test/ok/ --config=etc/awesome-ci.conf --ignore=".git/,*.pyc,test/,configure.in" --verbose - - bin/syntax-markdown --path=test/ok/ --config=etc/awesome-ci.conf --ignore=".git/,*.pyc,test/,configure.in" + #- bin/syntax-markdown --path=test/ok/ --config=etc/awesome-ci.conf --ignore=".git/,*.pyc,test/,configure.in" --list + #- bin/syntax-markdown --path=test/ok/ --config=etc/awesome-ci.conf --ignore=".git/,*.pyc,test/,configure.in" --verbose + #- bin/syntax-markdown --path=test/ok/ --config=etc/awesome-ci.conf --ignore=".git/,*.pyc,test/,configure.in" - bin/syntax-perl --path=test/ok/ --config=etc/awesome-ci.conf --ignore=".git/,*.pyc,test/,configure.in" --list - bin/syntax-perl --path=test/ok/ --config=etc/awesome-ci.conf --ignore=".git/,*.pyc,test/,configure.in" --verbose @@ -295,8 +292,8 @@ script: - if bin/syntax-json --path=test/err --config=etc/awesome-ci.conf --verbose; then false; else true; fi - if bin/syntax-json --path=test/err --config=etc/awesome-ci.conf; then false; else true; fi - - if bin/syntax-markdown --path=test/err --config=etc/awesome-ci.conf --verbose; then false; else true; fi - - if bin/syntax-markdown --path=test/err --config=etc/awesome-ci.conf; then false; else true; fi + #- if bin/syntax-markdown --path=test/err --config=etc/awesome-ci.conf --verbose; then false; else true; fi + #- if bin/syntax-markdown --path=test/err --config=etc/awesome-ci.conf; then false; else true; fi - if bin/syntax-perl --path=test/err --config=etc/awesome-ci.conf --verbose; then false; else true; fi - if bin/syntax-perl --path=test/err --config=etc/awesome-ci.conf; then false; else true; fi @@ -389,9 +386,9 @@ script: - bin/syntax-json --path=test/ok --config=etc/awesome-ci.conf --verbose - bin/syntax-json --path=test/ok --config=etc/awesome-ci.conf - - bin/syntax-markdown --path=test/ok --config=etc/awesome-ci.conf --list - - bin/syntax-markdown --path=test/ok --config=etc/awesome-ci.conf --verbose - - bin/syntax-markdown --path=test/ok --config=etc/awesome-ci.conf + #- bin/syntax-markdown --path=test/ok --config=etc/awesome-ci.conf --list + #- bin/syntax-markdown --path=test/ok --config=etc/awesome-ci.conf --verbose + #- bin/syntax-markdown --path=test/ok --config=etc/awesome-ci.conf - bin/syntax-perl --path=test/ok --config=etc/awesome-ci.conf --list - bin/syntax-perl --path=test/ok --config=etc/awesome-ci.conf --verbose diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..95154ee --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 cytopia + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 21b06c1..b282aea 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ [![OSX](https://raw.githubusercontent.com/cytopia/icons/master/64x64/osx.png)](https://www.apple.com/osx) - Lot's of tools for git, file and static source code analysis. **Documentation** @@ -60,6 +59,7 @@ All checks have the option to only check by one or more file **extensions**, by | Regex | [regex-grep](bin/regex-grep) | | `egrep` (`grep -E`) regex version to scan files for an occurance. | | Regex | [regex-perl](bin/regex-perl) | | `perl` regex version to scan files for an occurance. | + ## Learn / validate All of the above scripts offer the `--dry` option which will only show you the built command without actually executing it: @@ -75,6 +75,7 @@ find . -type f -not \( -path "./.git*" -o -path "./.svn*" \) ! -size 0 -print0 | xargs -0 -P 8 -n1 sh -c 'if [ -f "${1}" ]; then grep --color=always -inHE "if[[:space:]]*\[\[" "$1" || true; fi' -- ``` + ## Fix Some of the above scripts offer the `--fix` option (see table above), with which you are actually able to fix the problem. @@ -96,7 +97,6 @@ In order to give you an idea, have a look at the compiled [Regex Contributions]( Please use pull requests to add useful checks. - ## General Usage * All tools share the same pattern (except `git-ignored`) and can be used with the same command line arguments. @@ -129,12 +129,9 @@ Please use pull requests to add useful checks. --help # Show help --info # Show version of required binaries --version # Show tool version - ``` - - ## Installation ### Install OSX @@ -159,3 +156,10 @@ make install ./configure --prefix=/opt make install ``` + + +## License + +[MIT License](LICENSE.md) + +Copyright (c) 2016 [cytopia](https://github.com/cytopia) diff --git a/bin/file-cr b/bin/file-cr index e8f58c4..7bcec2a 100755 --- a/bin/file-cr +++ b/bin/file-cr @@ -62,8 +62,8 @@ MY_FIX_INFO="" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -408,15 +408,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/file-crlf b/bin/file-crlf index d7f96a3..e55c5fa 100755 --- a/bin/file-crlf +++ b/bin/file-crlf @@ -62,8 +62,8 @@ MY_FIX_INFO="dos2unix --version" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -408,15 +408,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/file-empty b/bin/file-empty index 1fe95c9..d21f2fc 100755 --- a/bin/file-empty +++ b/bin/file-empty @@ -59,8 +59,8 @@ MY_INFO="echo \"test is a built-in shell command\"" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -405,15 +405,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/file-nullbyte-char b/bin/file-nullbyte-char index 2da3d77..fd7355d 100755 --- a/bin/file-nullbyte-char +++ b/bin/file-nullbyte-char @@ -64,8 +64,8 @@ MY_FIX_INFO="" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -410,15 +410,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/file-trailing-newline b/bin/file-trailing-newline index 1b01d45..dd7af83 100755 --- a/bin/file-trailing-newline +++ b/bin/file-trailing-newline @@ -61,8 +61,8 @@ MY_INFO="aci-trailing-newline -v" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -407,15 +407,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/file-trailing-single-newline b/bin/file-trailing-single-newline index 2997b5a..c476ab5 100755 --- a/bin/file-trailing-single-newline +++ b/bin/file-trailing-single-newline @@ -62,8 +62,8 @@ MY_INFO="aci-trailing-newline -v" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -408,15 +408,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/file-trailing-space b/bin/file-trailing-space index d5efcc8..ac7d695 100755 --- a/bin/file-trailing-space +++ b/bin/file-trailing-space @@ -63,7 +63,7 @@ MY_INFO="grep -V | grep -E '([0-9]+\.+)+'" # Version # MY_VERSION="0.15" -MY_DATE="2017-05-20" +MY_DATE="2018-04-09" # # Credits @@ -408,15 +408,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/file-utf8 b/bin/file-utf8 index 1500b99..0b55293 100755 --- a/bin/file-utf8 +++ b/bin/file-utf8 @@ -61,8 +61,8 @@ MY_INFO="isutf8 --help | grep version" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -407,15 +407,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/file-utf8-bom b/bin/file-utf8-bom index 24bdc17..ced04f6 100755 --- a/bin/file-utf8-bom +++ b/bin/file-utf8-bom @@ -62,8 +62,8 @@ MY_INFO="(awk -Wversion 2>/dev/null || awk --version) | grep -E '(([0-9]+)(\.))+ # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -408,15 +408,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/git-conflicts b/bin/git-conflicts index 298f5f2..7aeb7c0 100755 --- a/bin/git-conflicts +++ b/bin/git-conflicts @@ -59,8 +59,8 @@ MY_INFO="grep -V | grep -E '([0-9]+\.+)+'" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -405,15 +405,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/git-ignored b/bin/git-ignored index b782454..d161a9a 100755 --- a/bin/git-ignored +++ b/bin/git-ignored @@ -36,8 +36,8 @@ MY_INFO="git --version" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits diff --git a/bin/inline-css b/bin/inline-css index a3ce335..5298efe 100755 --- a/bin/inline-css +++ b/bin/inline-css @@ -59,8 +59,8 @@ MY_INFO="grep -V | grep -E '([0-9]+\.+)+'" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -405,15 +405,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/inline-js b/bin/inline-js index df07ee3..fa2de84 100755 --- a/bin/inline-js +++ b/bin/inline-js @@ -59,8 +59,8 @@ MY_INFO="grep -V | grep -E '([0-9]+\.+)+'" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -405,15 +405,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/regex-grep b/bin/regex-grep index e8aa9f4..d6b789a 100755 --- a/bin/regex-grep +++ b/bin/regex-grep @@ -59,8 +59,8 @@ MY_INFO="grep -V | grep -E '([0-9]+\.+)+'" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -405,15 +405,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/regex-perl b/bin/regex-perl index 7c4dc90..865bc13 100755 --- a/bin/regex-perl +++ b/bin/regex-perl @@ -59,8 +59,8 @@ MY_INFO="perl --version | grep -E '(([0-9]+)(\.))+'" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -405,15 +405,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/syntax-bash b/bin/syntax-bash index d30f490..a7ddd03 100755 --- a/bin/syntax-bash +++ b/bin/syntax-bash @@ -59,8 +59,8 @@ MY_INFO="bash --version | grep -E '(([0-9]+)(\.))+'" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -405,15 +405,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/syntax-css b/bin/syntax-css index 488151b..90354d7 100755 --- a/bin/syntax-css +++ b/bin/syntax-css @@ -59,8 +59,8 @@ MY_INFO="scss-lint -v" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -405,15 +405,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/syntax-js b/bin/syntax-js index 10ebee3..63589f6 100755 --- a/bin/syntax-js +++ b/bin/syntax-js @@ -59,8 +59,8 @@ MY_INFO="eslint -v" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -405,15 +405,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/syntax-json b/bin/syntax-json index 928e868..82830e4 100755 --- a/bin/syntax-json +++ b/bin/syntax-json @@ -59,8 +59,8 @@ MY_INFO="jsonlint --version" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -405,15 +405,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/syntax-markdown b/bin/syntax-markdown index 2a46c73..8b86db0 100755 --- a/bin/syntax-markdown +++ b/bin/syntax-markdown @@ -59,8 +59,8 @@ MY_INFO="mdlint --version" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -405,15 +405,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/syntax-perl b/bin/syntax-perl index 1f6e12b..bed5c3d 100755 --- a/bin/syntax-perl +++ b/bin/syntax-perl @@ -59,8 +59,8 @@ MY_INFO="perl --version | grep -E '(([0-9]+)(\.))+'" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -405,15 +405,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/syntax-php b/bin/syntax-php index 43920c6..7e9527c 100755 --- a/bin/syntax-php +++ b/bin/syntax-php @@ -59,8 +59,8 @@ MY_INFO="php -v | grep -E '(^PHP)|(^Zend)' | awk -F'[,]' '{print \$1}' | awk -F' # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -405,15 +405,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/syntax-python b/bin/syntax-python index 596447a..4497371 100755 --- a/bin/syntax-python +++ b/bin/syntax-python @@ -59,8 +59,8 @@ MY_INFO="python --version" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -405,15 +405,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/syntax-ruby b/bin/syntax-ruby index 3314811..8ad0552 100755 --- a/bin/syntax-ruby +++ b/bin/syntax-ruby @@ -59,8 +59,8 @@ MY_INFO="ruby --version" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -405,15 +405,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/syntax-scss b/bin/syntax-scss index 5d9d8cb..61aa0a7 100755 --- a/bin/syntax-scss +++ b/bin/syntax-scss @@ -59,8 +59,8 @@ MY_INFO="scss-lint -v" # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -405,15 +405,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi } diff --git a/bin/syntax-sh b/bin/syntax-sh index 08229b2..cd72b41 100755 --- a/bin/syntax-sh +++ b/bin/syntax-sh @@ -57,8 +57,8 @@ MY_INFO="(sh --version >/dev/null 2>&1) && (sh --version|grep -E '(([0-9]+)(\.)) # # Version # -MY_VERSION="0.14" -MY_DATE="2016-11-01" +MY_VERSION="0.15" +MY_DATE="2018-04-09" # # Credits @@ -403,15 +403,10 @@ check_config_file() { # (defaults to 1 if impossible) # num_cpu() { - _num="$(getconf _NPROCESSORS_ONLN)" - - # Worked - if [ "$?" = "0" ]; then - echo "${_num}" - return 0 - else + if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then echo "1" - return 1 + else + echo "${_num}" fi }