first-choice-selection-gulpfile.js 611 B

12345678910111213141516171819202122
  1. 'use strict';
  2. var gulp = require( 'gulp' );
  3. var prompt = require('../index');
  4. /**
  5. * The following is a sample gulp file for getting the first selection from a choice
  6. * This was put together in response to issue #27
  7. * (https://github.com/Freyskeyd/gulp-prompt/issues/27)
  8. */
  9. gulp.task( 'selectFirst', () => {
  10. return gulp.src( '../package.json' )
  11. .pipe( prompt.prompt({
  12. type:'list',
  13. name:'env',
  14. message:'Please enter selection?',
  15. choices: ['First','Second','Third']
  16. }, (res) => {
  17. console.log('Result', res);
  18. }) );
  19. });