Comments (11)
The cwd will always be the gulpfile directory when using the CLI https://github.com/wearefractal/gulp/blob/master/bin/gulp.js#L93
It's semi-reliable to just use process.cwd() assuming they didn't run it with node.
from gulp-util.
Doesn't that defeats its purpose if it can't be run with node?
from gulp-util.
@sindresorhus If you are relying on cwd (using relative paths) you have a few options
- Use the gulp CLI
- Use node from the same dir as your gulpfile
- Add process.chdir(__dirname) to the top of your gulpfile
from gulp-util.
k, but should at least be documented as it can cause obscure errors if you're not aware.
from gulp-util.
the behaviour of process.cwd() should also be documented as a way to get gulpfile relative paths.
from gulp-util.
@sindresorhus Your plugin shouldnt need to get the gulpfile path - you can just require() whatever path they pass in since they are ultimately in charge of relativity (using one of the 3 methods above). If they don't use any of the 3 methods above then they need to pass in the full path to their config file themselves since they aren't using relativity anyways
from gulp-util.
@contra hm, you might be right. the thing is that the file should be somewhere relative to the gulpfile so thought it would make sense to make it relative by default for ease of use.
from gulp-util.
@sindresorhus For gulp-jshint I support them passing in an object for settings, them require()ing their conf file and passing it in (handled same as the first way), or them passing a full path string and the plugin requires it in
from gulp-util.
@contra good point: jscs-dev/gulp-jscs@9bd1fc5
from gulp-util.
@sindresorhus Do you think this needs further discussion/consideration or does letting the user handle relativity sound good to you?
from gulp-util.
Works for me, but needs docs as mentioned.
from gulp-util.
Related Issues (20)
- The README on npm doesn't have the deprecation note HOT 1
- more helpful replacement pointers HOT 8
- [email protected]
- deprecated [email protected] used on [email protected] > [email protected] HOT 3
- deprecated [email protected] used on [email protected] HOT 1
- [email protected] deprecated HOT 2
- gulp
- Gulp throws assertion error after fixing gulp-util deprecation with gulp-cli HOT 2
- Error cannot find gulp-util after attempting to fix assertion issue HOT 2
- Cannot find module 'gulp-util' HOT 3
- remove gulp-util HOT 1
- ecosystem
- remove gulp-util HOT 1
- remove gulp-util
- remove gulp-util
- [email protected]: is deprecated
- Please run `npm deprecate` HOT 1
- remove gulp-util by replacing the API listed below
- Can not install gulp on my project via npm HOT 1
- Security vulnerability HOT 1
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-util.