Creating Files and Directories?


#1

Simple API question here. What do you need to require to instantiate Files and Directories?

Atom’s core requires them from atom/node-pathwatcher. If I add a dependency on pathwatcher in my module, it breaks because it uses a isn’t version-synced with the package in core and loads the wrong dylib (I think). I might be able to just require the same version that Atom’s core does, but that seems too fragile.

Am I missing something simple?


#2

Is this the error that you’re getting?

Failed to activate package named 'atom-test' Error: Module version mismatch. Expected 13, got 11.

#3

Yeah, that’s it exactly. Did I misread what it meant?


#4

From your branch in atom-cloud-sync I was able to add

{
...
    "pathwatcher": "^1.0"
...
}

Then require it in one of the modules that got loaded. At first it wasn’t working right but after closing out and running

apm update
apm upgrade
apm install

I was able to require and use pathwatcher just fine.


#5

:cool:, that works for the moment, at least. Thanks!


#6

Also: it’s quite useful that atom.project.getRootDirectory() returns spec/fixtures by default. :grin: