From d23eb0da29c2400ffe0372dea02355fed91a5ced Mon Sep 17 00:00:00 2001 From: ehmicky Date: Mon, 20 May 2019 10:00:00 +0200 Subject: [PATCH] Add exec() example --- examples/exec.gulpfile.js | 17 +++++++++++++++++ examples/exec.sh | 12 ++++++++++++ examples/task.gulpfile.js | 2 +- examples/task.sh | 2 +- 4 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 examples/exec.gulpfile.js create mode 100644 examples/exec.sh diff --git a/examples/exec.gulpfile.js b/examples/exec.gulpfile.js new file mode 100644 index 0000000..f03b4c1 --- /dev/null +++ b/examples/exec.gulpfile.js @@ -0,0 +1,17 @@ +// Demo of the `exec()` method. +// This file can be directly run: +// - first install `gulp-execa` and `gulp` +// - then `bash node_modules/gulp-execa/examples/exec.sh` +// An online demo is also available at: +// https://repl.it/@ehmicky/gulp-execa + +'use strict' + +// Ignore the following line: this is only needed for internal purposes. +require('./utils.js') + +const { exec } = require('gulp-execa') + +module.exports.default = async function defaultTask() { + await exec('npm --version', { verbose: true }) +} diff --git a/examples/exec.sh b/examples/exec.sh new file mode 100644 index 0000000..582fe0b --- /dev/null +++ b/examples/exec.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# Demo of the `exec()` method. +# This file can be directly run: +# - first install `gulp-execa` and `gulp` +# - then `bash node_modules/gulp-execa/examples/exec.sh` +# An online demo is also available at: +# https://repl.it/@ehmicky/gulp-execa + +# Ignore the following line: this is only needed for internal purposes. +. "$(dirname "$BASH_SOURCE")/utils.sh" + +gulp --gulpfile="$dir/exec.gulpfile.js" diff --git a/examples/task.gulpfile.js b/examples/task.gulpfile.js index 45e64b2..6767bee 100644 --- a/examples/task.gulpfile.js +++ b/examples/task.gulpfile.js @@ -1,7 +1,7 @@ // Demo of the `task()` method. // This file can be directly run: // - first install `gulp-execa` and `gulp` -// - then `bash node_modules/gulp-execa/examples/FILE.sh` +// - then `bash node_modules/gulp-execa/examples/task.sh` // An online demo is also available at: // https://repl.it/@ehmicky/gulp-execa diff --git a/examples/task.sh b/examples/task.sh index e2e7c8e..41ef017 100644 --- a/examples/task.sh +++ b/examples/task.sh @@ -2,7 +2,7 @@ # Demo of the `task()` method. # This file can be directly run: # - first install `gulp-execa` and `gulp` -# - then `bash node_modules/gulp-execa/examples/FILE.sh` +# - then `bash node_modules/gulp-execa/examples/task.sh` # An online demo is also available at: # https://repl.it/@ehmicky/gulp-execa