-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from shannonlal/v-0-3-2-List-Selection-Size
V 0 3 2 list selection size
- Loading branch information
Showing
3 changed files
with
46 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
'use strict'; | ||
|
||
var gulp = require( 'gulp' ); | ||
var prompt = require('../index'); | ||
|
||
/** | ||
* The following is a sample gulp file for getting the list selection size from the command prompt | ||
* Note: Gulp Prompt is a wrapper around inquirer.js so if it is available in inquirer.js | ||
* it should be available within gulp-prompt. The prompt function is essentially a straight | ||
* passthrough to the inquirer.js library. The page size variable is what sets the length of display | ||
* items in list | ||
* | ||
* https://github.com/SBoudrias/Inquirer.js#questions | ||
*/ | ||
gulp.task( 'getSelection', () => { | ||
return gulp.src( './package.json' ) | ||
.pipe( prompt.prompt({ | ||
type:'list', | ||
name:'env', | ||
message:'Please enter selection?', | ||
choices: ['a','b','c','d','e','f', 'g', 'h'], | ||
pageSize:'3' | ||
}, (res) => { | ||
console.log('Result', res); | ||
}) ); | ||
}); | ||
|
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