Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-shell

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-shell - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

2

package.json
{
"name": "grunt-shell",
"version": "0.3.1",
"version": "0.4.0",
"description": "Run shell commands",

@@ -5,0 +5,0 @@ "keywords": [

@@ -31,2 +31,21 @@ # grunt-shell

### Example config
```js
grunt.initConfig({
shell: { // Task
listFolders: { // Target
options: { // Options
stdout: true
},
command: 'ls'
}
}
});
grunt.loadNpmTasks('grunt-shell');
grunt.registerTask('default', ['shell']);
```
### Example usage

@@ -39,8 +58,10 @@

```javascript
shell: {
makeDir: {
command: 'mkdir test'
```js
grunt.initConfig({
shell: {
makeDir: {
command: 'mkdir test'
}
}
}
});
```

@@ -50,9 +71,11 @@

```javascript
testDir: 'test',
shell: {
makeDir: {
command: 'mkdir <%= testDir %>'
```js
grunt.initConfig({
testDir: 'test',
shell: {
makeDir: {
command: 'mkdir <%= testDir %>'
}
}
}
});
```

@@ -62,10 +85,26 @@

```javascript
```js
grunt.initConfig({
shell: {
makeDir: {
command: function () {
return 'echo hello';
}
}
}
});
```
Which can also take arguments:
```js
shell: {
makeDir: {
command: function () {
return 'echo hello';
command: function (greeting) {
return 'echo ' + greeting;
}
}
}
grunt.loadNpmTasks('grunt-shell');
grunt.registerTask('default', ['shell:hello']);
```

@@ -78,11 +117,13 @@

```javascript
shell: {
dirListing: {
command: 'ls',
options: {
stdout: true
```js
grunt.initConfig({
shell: {
dirListing: {
command: 'ls',
options: {
stdout: true
}
}
}
}
});
```

@@ -95,3 +136,3 @@

```javascript
```js
function log(err, stdout, stderr, cb) {

@@ -102,12 +143,12 @@ console.log(stdout);

...
shell: {
dirListing: {
command: 'ls',
options: {
callback: log
grunt.initConfig({
shell: {
dirListing: {
command: 'ls',
options: {
callback: log
}
}
}
}
});
```

@@ -120,14 +161,16 @@

```javascript
shell: {
subfolderLs: {
command: 'ls',
options: {
stdout: true,
execOptions: {
cwd: 'tasks'
```js
grunt.initConfig({
shell: {
subfolderLs: {
command: 'ls',
options: {
stdout: true,
execOptions: {
cwd: 'tasks'
}
}
}
}
}
});
```

@@ -140,12 +183,14 @@

```javascript
shell: {
multiple: {
command: [
'mkdir test',
'cd test',
'ls'
].join('&&')
```js
grunt.initConfig({
shell: {
multiple: {
command: [
'mkdir test',
'cd test',
'ls'
].join('&&')
}
}
}
});
```

@@ -152,0 +197,0 @@

@@ -20,3 +20,3 @@ 'use strict';

cmd = grunt.template.process(_.isFunction(cmd) ? cmd.call(grunt) : cmd);
cmd = grunt.template.process(_.isFunction(cmd) ? cmd.apply(grunt, arguments) : cmd);

@@ -23,0 +23,0 @@ var cp = exec(cmd, options.execOptions, function (err, stdout, stderr) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc