noseglid / atom-build

:hammer: Build your project directly from the Atom editor
https://atom.io/packages/build
MIT License
248 stars 97 forks source link

Build provider is executed twice when one project has been removed #419

Closed Obijuan closed 8 years ago

Obijuan commented 8 years ago

I've create a simple builder test provider:

class BuildTestProvider {

  constructor(cwd) {
    this.cwd = cwd;
    this.title = 'TEST';

    console.log("New Test Builder!!!");
  }

  getNiceName() {
    return this.title;
  }

  isEligible() {
    return true;
  }

  settings() {

    //-- Available apio commands
    return [

        //-- APIO build
        {
          name: 'Test:Build',
          exec: 'apm',
          sh: true,
          args: [ '--version'],
          keymap: 'ctrl-alt-v',
          atomCommandName: 'test:build',
        },
    ];
  } 
}

It just invoke the command apm --version (for testing purposes)

I open 2 projects (with file/add project folder). The build provider is executed two times, one for each project, as expected. But if one project folder is removed (right click on the root folder and choosing the option "remove project folder") the build provider is executed twice as well, when it should be executed only once, as there is only one remaining project

noseglid commented 8 years ago

I'm unable to reproduce this, see this gif (i'm printing the cwd it's getting settings from): add-path

Could there be something else causing this?

cr1901 commented 8 years ago

I don't have the SAME exact issue, but I do notice that with a custom builder I am getting two processes spawned when building a single target. This was immediately after an upgrade to the most recent version.

Restarting atom, which installed a new dependency called busy, solved the problem.

noseglid commented 8 years ago

@cr1901 Yea that's been known to happen from time to time. It's a problem in Core Atom, not package specific.

I'll close this as inactive.

Jesus89 commented 7 years ago

Hi, I add more information about this issue: The problem is that BuildTestProvider registers N triggers for N project folders and then the command "test:build" is called N times, even if you remove a project folder.

Jesus89 commented 7 years ago

I have created a project to test this issue: https://github.com/Jesus89/atom-build-test. It seems that trigger register is not working properly. I would expect the same behavior in the "test:hello" menu command that in "Select active target > Test: Hello".