From 3fbb56d9cffa24c18748175ff890c6a10a2fb342 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Sun, 30 Oct 2016 19:30:55 +0100 Subject: [PATCH] Moved scripts into bin --- .githooks/pre-commit/lint.sh | 2 +- bin/build | 31 +++++++++++++++++++++++++++++++ bin/clean | 31 +++++++++++++++++++++++++++++++ bin/lint | 31 +++++++++++++++++++++++++++++++ bin/start | 32 ++++++++++++++++++++++++++++++++ bin/test | 31 +++++++++++++++++++++++++++++++ package.json | 10 +++++----- 7 files changed, 162 insertions(+), 6 deletions(-) create mode 100755 bin/build create mode 100755 bin/clean create mode 100755 bin/lint create mode 100755 bin/start create mode 100755 bin/test diff --git a/.githooks/pre-commit/lint.sh b/.githooks/pre-commit/lint.sh index aa3400ff3..abf7df73c 100755 --- a/.githooks/pre-commit/lint.sh +++ b/.githooks/pre-commit/lint.sh @@ -49,7 +49,7 @@ fi # Run the check and print indicator echo "Hook[pre-commit]: Running linter..." -STD_OUT=$(npm run pre-commit --silent) +STD_OUT=$(npm run lint --silent) # Grab exit code of check HAD_ERROR=$? diff --git a/bin/build b/bin/build new file mode 100755 index 000000000..d7620ba61 --- /dev/null +++ b/bin/build @@ -0,0 +1,31 @@ +#!/bin/bash + +# Copyright (c) 2016 Martin Donath + +# 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 NON-INFRINGEMENT. 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. + +# Check if "npm install" was executed +if [ ! -d ../node_modules ]; then + echo "\"node_modules\" not found:" + echo "npm install" + exit 1 +fi + +# Run command +$(pwd)/node_modules/.bin/gulp build --clean --optimize --revision diff --git a/bin/clean b/bin/clean new file mode 100755 index 000000000..7838787b0 --- /dev/null +++ b/bin/clean @@ -0,0 +1,31 @@ +#!/bin/bash + +# Copyright (c) 2016 Martin Donath + +# 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 NON-INFRINGEMENT. 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. + +# Check if "npm install" was executed +if [ ! -d ../node_modules ]; then + echo "\"node_modules\" not found:" + echo "npm install" + exit 1 +fi + +# Run command +$(pwd)/node_modules/.bin/gulp clean diff --git a/bin/lint b/bin/lint new file mode 100755 index 000000000..44371fa95 --- /dev/null +++ b/bin/lint @@ -0,0 +1,31 @@ +#!/bin/bash + +# Copyright (c) 2016 Martin Donath + +# 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 NON-INFRINGEMENT. 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. + +# Check if "npm install" was executed +if [ ! -d ../node_modules ]; then + echo "\"node_modules\" not found:" + echo "npm install" + exit 1 +fi + +# Run command +$(pwd)/node_modules/.bin/sass-lint -c .sass-lint.yml -vq diff --git a/bin/start b/bin/start new file mode 100755 index 000000000..539e42e8c --- /dev/null +++ b/bin/start @@ -0,0 +1,32 @@ +#!/bin/bash + +# Copyright (c) 2016 Martin Donath + +# 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 NON-INFRINGEMENT. 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. + +# Check if "npm install" was executed +if [ ! -d $(pwd)/node_modules ]; then + ls $(pwd) + echo "\"node_modules\" not found:" + echo "npm install" + exit 1 +fi + +# Run command +$(pwd)/node_modules/.bin/gulp watch --no-lint diff --git a/bin/test b/bin/test new file mode 100755 index 000000000..3098499bc --- /dev/null +++ b/bin/test @@ -0,0 +1,31 @@ +#!/bin/bash + +# Copyright (c) 2016 Martin Donath + +# 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 NON-INFRINGEMENT. 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. + +# Check if "npm install" was executed +if [ ! -d ../node_modules ]; then + echo "\"node_modules\" not found:" + echo "npm install" + exit 1 +fi + +# Run command +$(pwd)/node_modules/.bin/gulp test diff --git a/package.json b/package.json index 9eb71987e..0b4507013 100644 --- a/package.json +++ b/package.json @@ -23,11 +23,11 @@ "url": "https://github.com/squidfunk/mkdocs-material.git" }, "scripts": { - "build": "./node_modules/.bin/gulp build --clean --optimize --revision", - "clean": "./node_modules/.bin/gulp clean", - "pre-commit": "./node_modules/.bin/sass-lint -c .sass-lint.yml -vq", - "start": "./node_modules/.bin/gulp watch --no-lint", - "test": "./node_modules/.bin/gulp test" + "build": "bin/build", + "clean": "bin/clean", + "lint": "bin/lint", + "start": "bin/start", + "test": "bin/test" }, "dependencies": { "fastclick": "^1.0.6",