-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Working dir #53
Comments
I think we should keep in mind that this is still nodejs, and users know that any operation is based on the cwd. If this is not the desired behaviour, users can use the filter to do whatever they need to the paths. I'm open to discussion, but I still haven't seen a strong reason why we should be making magic. |
@marcooliveira The problem is that project level tasks usually use relative references. The |
What if the user tries to run |
I see your point. What about making an attribute of the task itself, living next to |
Although that solves the issue, might lead to inconsistencies in task behaviour, since some developers might use __dirname, other process.cwd(). This issue is only real when a user does something, like you said, My opinion on this, is that this is nodejs, and people need to understand that they are running nodejs, not some magic code. If they need a stronger way to reference a file, without any annoyance of relative paths, they can always use absolute paths. I'm still open to discuss this further, but haven't seen any strong reason why we should do something else. |
This kind of issues will be mitigated with #30. We can reopen this if necessary later on. Right @marcooliveira ? |
Yep! Fine with me, don't see this as a real issue yet. Let's wait for some feedback from the community, and see if it applies. Closing for now. |
At the moment, all operations made within tasks are relative to where automaton runs.
Deep tasks have to use
__dirname
to perform operations with files referenced relatively. While this is an issue, only task devs will have to worry about it. I think we shouldn't do any magic regarding this.Still project level autofiles, specially the ones located in
tasks/
folder will suffer from this problem. If they try to specify files tocp
, they will have to specify it relative to the project directory and not relative to the task itself.Grunt
makes the working directory relative to thegruntfile
. I think that we should do the same, but we would have to doprocess.chdir
. This is not actually good when automaton is being used programatically, unless we document it well or we spawn afork
to actually run automaton tasks.The text was updated successfully, but these errors were encountered: