Skip to content
This repository was archived by the owner on Nov 7, 2020. It is now read-only.

Commit a39320a

Browse files
committed
replace grunt with npm scripts
1 parent 47691df commit a39320a

File tree

5 files changed

+61
-103
lines changed

5 files changed

+61
-103
lines changed

Gruntfile.js

Lines changed: 0 additions & 98 deletions
This file was deleted.

npm_scripts/icon.png

14.6 KB
Loading

npm_scripts/php-fix.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
#
3+
# NPM: PHP Coding Standards (Fix)
4+
#
5+
# These are a little too cumbersome to deal with inside NPM.
6+
##
7+
8+
9+
10+
# Check dependencies.
11+
if [ ! -e "./node_modules/blobfolio-phpcs/lib/vendor/bin/phpcbf" ]; then
12+
echo -e "\033[31;1mError:\033[0m blobfolio-phpcs is required."
13+
echo -e "\033[96;1mFix:\033[0m npm i git+ssh://[email protected]:3417/blobfolio-phpcs"
14+
exit 1
15+
fi
16+
17+
18+
19+
# This is just one command, but it is a bitch.
20+
./node_modules/blobfolio-phpcs/lib/vendor/bin/phpcbf --colors --standard=Blobfolio --encoding=utf8 --extensions=php --parallel=4 ./
21+
22+
23+
24+
exit 0

npm_scripts/php.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
#
3+
# NPM: PHP Coding Standards
4+
#
5+
# These are a little too cumbersome to deal with inside NPM.
6+
##
7+
8+
9+
10+
# Check dependencies.
11+
if [ ! -e "./node_modules/blobfolio-phpcs/lib/vendor/bin/phpcs" ]; then
12+
echo -e "\033[31;1mError:\033[0m blobfolio-phpcs is required."
13+
echo -e "\033[96;1mFix:\033[0m npm i git+ssh://[email protected]:3417/blobfolio-phpcs"
14+
exit 1
15+
fi
16+
17+
18+
19+
./node_modules/blobfolio-phpcs/lib/vendor/bin/phpcs --colors --standard=Blobfolio --encoding=utf8 --report=full --extensions=php --parallel=4 ./
20+
if [ $? -eq 0 ]; then
21+
# Everything was fine; just log to the terminal and exit.
22+
echo -e "\033[32;1mSuccess:\033[0m Your PHP is looking good!"
23+
else
24+
# Try one more time without warnings to see if this is bad or not.
25+
./node_modules/blobfolio-phpcs/lib/vendor/bin/phpcs --colors --standard=Blobfolio --encoding=utf8 --report=notifysend --extensions=php --parallel=4 ./
26+
fi
27+
28+
29+
30+
exit 0

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
22
"name": "blob-domain",
33
"devDependencies": {
4-
"grunt": "*",
5-
"grunt-contrib-clean": "*",
6-
"grunt-contrib-watch": "*",
7-
"grunt-notify": "*",
8-
"grunt-blobfolio": "git+ssh://[email protected]:3417/grunt-blobfolio"
4+
"blobfolio-phpcs": "git+ssh://[email protected]:3417/blobfolio-phpcs"
5+
},
6+
"scripts": {
7+
"preinstall": "npm list onchange -g || npm install onchange -g",
8+
"watch": "onchange '*.php' '**/*.php' -- npm run -s php",
9+
"php": "npm_scripts/php.sh",
10+
"php:fix": "npm_scripts/php-fix.sh"
911
}
1012
}

0 commit comments

Comments
 (0)