nickdodd79 / vscode-gulptasks

A gulp task visualization and execution extension for Visual Studio Code
MIT License
7 stars 6 forks source link

Support gulpfile.js outside the workspace root #1

Closed tdabasinskas closed 6 years ago

tdabasinskas commented 6 years ago

Hi,

It seems that the extension searches for the gulpfile.js file only under the workspace root:

  const file = path.join(workspaceRoot, 'gulpfile.js');

  if (!await exists(file)) {
    utils.outputInfo('No gulp file found in the current workspace.');
    return emptyTasks;
  }

This might be OK in some cases, but there might be cases when the file is nested deeper in the directory. An example case could be a Visual Studio project, with the following structure:

─ ProjectFolder
   ├─ .git
   ├─ src
   │    ├─ Program.cs
   │    └─ gulpfile.js
   └─ Project.sln

Would it be possible to make it so the extension is able to find a nested gulpfile.js as well?

Thank you.

nickdodd79 commented 6 years ago

Hi @TDabasinskas

I have some other changes to make so I'll certainly give it a go a part of that.

Nick.

nickdodd79 commented 6 years ago

Hi @TDabasinskas

I have published a 0.0.4 version of the extension that now traverses the workspace to discover a gulp file.

Note that it will use the first one it finds. I am looking to include the ability to discover multiple gulp files with some rework around what the tree displays.

Nick.

tdabasinskas commented 6 years ago

Hi @nickdodd79,

It indeed seems to be working just fine now:

[Info] Discovering gulp file ...
[Info] Discovered: C:\Projects\Project\src\gulpfile.js
[Info] Loading gulp tasks ...
[Info] Loaded 9 gulp tasks.

Thank you!