-
-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86680b4
commit 62cdda5
Showing
10 changed files
with
97 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
* text=auto | ||
*.js text eol=lf | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package-lock=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- '10' | ||
- '8' | ||
- '6' | ||
- '4' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,9 @@ | ||
The MIT License (MIT) | ||
MIT License | ||
|
||
Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com) | ||
|
||
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: | ||
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 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. | ||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,44 @@ | ||
{ | ||
"name": "grunt-shell", | ||
"version": "2.1.0", | ||
"description": "Run shell commands", | ||
"license": "MIT", | ||
"repository": "sindresorhus/grunt-shell", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "[email protected]", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"test": "xo && grunt" | ||
}, | ||
"files": [ | ||
"tasks" | ||
], | ||
"keywords": [ | ||
"gruntplugin", | ||
"shell", | ||
"command", | ||
"cmd", | ||
"exec", | ||
"spawn", | ||
"child", | ||
"process", | ||
"cli" | ||
], | ||
"dependencies": { | ||
"chalk": "^1.0.0", | ||
"npm-run-path": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"grunt": "^1.0.1", | ||
"grunt-cli": "^1.2.0", | ||
"xo": "0.20.3" | ||
}, | ||
"peerDependencies": { | ||
"grunt": ">=0.4.0" | ||
}, | ||
"xo": { | ||
"esnext": true | ||
} | ||
"name": "grunt-shell", | ||
"version": "2.1.0", | ||
"description": "Run shell commands", | ||
"license": "MIT", | ||
"repository": "sindresorhus/grunt-shell", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "[email protected]", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=6" | ||
}, | ||
"scripts": { | ||
"test": "xo && grunt" | ||
}, | ||
"files": [ | ||
"tasks" | ||
], | ||
"keywords": [ | ||
"gruntplugin", | ||
"shell", | ||
"command", | ||
"cmd", | ||
"exec", | ||
"spawn", | ||
"child", | ||
"process", | ||
"cli" | ||
], | ||
"dependencies": { | ||
"chalk": "^2.4.1", | ||
"npm-run-path": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"grunt": "^1.0.1", | ||
"grunt-cli": "^1.2.0", | ||
"xo": "^0.23.0" | ||
}, | ||
"peerDependencies": { | ||
"grunt": ">=1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,28 +2,26 @@ | |
|
||
> Run shell commands | ||
A good way to interact with other CLI tools. E.g. compiling Compass `compass compile` or get the current git branch `git branch`. | ||
A good way to interact with other CLI tools. For example, get the current Git branch with `git branch`. | ||
|
||
**Use [Stack Overflow](https://stackoverflow.com/questions/tagged/gruntjs) for support questions.** | ||
|
||
--- | ||
|
||
<p align="center"><b>🔥 Want to strengthen your core JavaScript skills and master ES6?</b><br>I would personally recommend this awesome <a href="https://ES6.io/friend/AWESOME">ES6 course</a> by Wes Bos.</p> | ||
|
||
--- | ||
|
||
|
||
## Install | ||
|
||
``` | ||
$ npm install --save-dev grunt-shell | ||
``` | ||
|
||
<a href="https://www.patreon.com/sindresorhus"> | ||
<img src="https://c5.patreon.com/external/logo/[email protected]" width="160"> | ||
</a> | ||
|
||
|
||
## Usage | ||
|
||
```js | ||
require('load-grunt-tasks')(grunt); // npm install --save-dev load-grunt-tasks | ||
require('load-grunt-tasks')(grunt); | ||
|
||
grunt.initConfig({ | ||
shell: { | ||
|
@@ -33,7 +31,7 @@ grunt.initConfig({ | |
target: { | ||
command: 'ls' | ||
}, | ||
another: 'ls ./src' // shorthand | ||
another: 'ls ./src' // Shorthand | ||
} | ||
}); | ||
|
||
|
@@ -90,7 +88,7 @@ module.exports = grunt => { | |
grunt.initConfig({ | ||
shell: { | ||
greet: { | ||
command: greeting => 'echo ' + greeting | ||
command: greeting => `echo ${greeting}` | ||
} | ||
} | ||
}); | ||
|
@@ -117,14 +115,14 @@ grunt.initConfig({ | |
Do whatever you want with the output. | ||
|
||
```js | ||
function log(err, stdout, stderr, cb) { | ||
if (err) { | ||
cb(err); | ||
function log(error, stdout, stderr, callback) { | ||
if (error) { | ||
callback(error); | ||
return; | ||
} | ||
|
||
console.log(stdout); | ||
cb(); | ||
callback(); | ||
} | ||
|
||
grunt.initConfig({ | ||
|
@@ -141,7 +139,7 @@ grunt.initConfig({ | |
|
||
### Option passed to the .exec() method | ||
|
||
Run a command in another directory. In this example we run it in a subfolder using the `cwd` (current working directory) option. | ||
Run a command in another directory. In this example, we run it in a subfolder using the `cwd` (current working directory) option. | ||
|
||
```js | ||
grunt.initConfig({ | ||
|
@@ -233,13 +231,13 @@ Default: `false` | |
|
||
Set `stdin` to [act as a raw device](https://nodejs.org/api/tty.html#tty_readstream_setrawmode_mode). | ||
|
||
### callback(err, stdout, stderr, cb) | ||
### callback(error, stdout, stderr, callback) | ||
|
||
Type: `Function` | ||
|
||
Lets you override the default callback with your own. | ||
|
||
**Make sure to call the `cb` method when you're done.** Supply an error as the first argument to `cb` to print a warning and cause the task to fail. | ||
**Make sure to call the `callback` method when you're done.** Supply an error as the first argument to `callback` to print a warning and cause the task to fail. | ||
|
||
### preferLocal | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters