Comments (11)
If somebody wants to make the autocomplete files (these https://github.com/gruntjs/grunt-cli/tree/master/completion) for gulp I would be open to accepting a PR
from gulp.
This will need more investigation, than I thought at first. Gulp cli do not lists tasks in "--help", so way that grunt does autocompletion (greps help output) is not suitable. But it can be done, if we manage write this autocompletion script in node - if this is possible, then all that we need is require gulpfile.js and list its this.tasks
.
P.s. May be it's possible to fetch tasks from one-liner: node -e "console.log(require('{$GULPFILE}').tasks.join(' '))"
from gulp.
@floatdrop That seems like the easiest solution
from gulp.
this.tasks
is an object of more than just names. It seems like orchestrator could benefit from a .taskNames()
that harvested that list though.
from gulp.
@robrich node -e "console.log(Object.keys(require('{$GULPFILE}').tasks).join(' '))"
will probably be good enough. No need to add more API surface to support edge cases
from gulp.
Too bad, that gulpfile.js
do not exposes nothing (since there is no exports
in it).
from gulp.
@floatdrop what would it export?
from gulp.
@sindresorhus gulp
instance would be enough - after you get it, you can access his .task
property and extract tasks names from it.
from gulp.
@floatdrop somewhat hacky, but something like this should do it:
var gulp = require('require-modify')('./gulpfile', function (src) {
return src + ';module.exports = gulp;';
});
the beginning ;
is in case the user have forgotten a semicolon on the last statement
https://github.com/sindresorhus/require-modify
from gulp.
Because the gulp object is a singleton, couldn't you do this as well?
var gulp = require('gulp');
require('./gulpfile');
console.log(Object.keys(gulp.tasks).join(' '));
from gulp.
@timrwood cool! This will do the trick node -e "var gulp = require('gulp'); require('./gulpfile'); console.log(Object.keys(gulp.tasks).join(' '));"
from gulp.
Related Issues (20)
- RangeError: Maximum call stack size exceeded HOT 2
- Gulp 5 corrupt images HOT 3
- v5 : Series tasks fail where running individually pass HOT 4
- Gulp 5 - Copied images using .src and .dest are corrupt HOT 3
- In gulp 4.0.2 fonts are displayed correctly, and in version 5.0.0 there are constant errors HOT 3
- Gulp v5.0.0 png and jpg images not opening after transferring via gulp HOT 2
- v5: after updating gulp to version 5, jpg and png files are not readable after src-dest processing HOT 7
- Option no-sort doesn't seem to work on gulp 5.0.0 HOT 5
- Gulp v5.0.0 does not work if the root folder contains too many files (Works in Gulp v4.0.2) HOT 1
- Static files broken HOT 2
- Simple gulp copy garbles font files HOT 10
- PNG files are corrupted after Gulp upgrade to 5.0 HOT 7
- v5: Stuck in infinite loop in some cases HOT 3
- Gulp.src/gulp.dest does not copy images or fonts correctly in [email protected] HOT 3
- Gulp v5 corrupt font files HOT 5
- not support node22 HOT 1
- gulp imagemin task is not working properly for the v5.0.0 gulp HOT 2
- Test fail on the latest version HOT 3
- `Unhandled 'error' event` error in gulp 5 HOT 3
- Corruption of image files during migration or optimization HOT 31
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp.