Build Atom with preselected packages



in our private environment we have a set of packages that are not hosted on github.
We are trying to build atom with the set of private packages.

neither the deb package nor the Windows Setup.exe/msi and builds
include the packages placed in the dot-atom folder (sources).

If the own builds are started for the first time, the .atom folder is created upon first execution.
Also the storage folder is created but no sign of the packages folder.

If though, the release is downloaded from github, unziped and started
for the first time, the .atom folder is created including the packges folder containing a

Somehow it must be possible to include packages in the builds. Can someone give me a hint?

thank you for your help


Building Atom with different packages

There is a packageDependencies section in the Atom package.json, but it will only pull packages from If you want to include packages in the build from some other source, you’ll need to devise your own way to do so.


Okay, then i might have to change the src.
What i still dont understand is, why if build by me
all the dot-atom files are not placed in the .atom folder at first execution.
Why having this folder in the source at the first place?

Also, the config module “src/” contains a method “initializeConfigDirectory”

initializeConfigDirectory: (done) ->
    return if fs.existsSync(@configDirPath) or @shouldNotAccessFileSystem()


    queue = async.queue ({sourcePath, destinationPath}, callback) ->
      fs.copy(sourcePath, destinationPath, callback)
    queue.drain = done

    templateConfigDirPath = fs.resolve(@resourcePath, 'dot-atom')
    onConfigDirFile = (sourcePath) =>
      relativePath = sourcePath.substring(templateConfigDirPath.length + 1)
      destinationPath = path.join(@configDirPath, relativePath)
      queue.push({sourcePath, destinationPath})
    fs.traverseTree(templateConfigDirPath, onConfigDirFile, ((path) -> true), (->))

This method is supposed the take the bundled dot-atom folder und unpack it if it not exists.


I’m not sure what you’re asking. Can you be more specific?


To me there seems to be a bug in the creation of C:\Users\USERNAME.atom .
But i haven’t figured out where something goes wrong.

If i download an official atom releas and start it for the first time,
the folder C:\Users\USERNAME.atom\packages
and the files, keymap,cson, snippets.cson, style.less
are created. This is not the case for the (32bit build).
Also, if i build atom manually and start the editor i dont have the, keymap.cson etc…

So the question is, why are the files init.coffeee, keymap.cson, snippets.cson, style.less and the folder packages are not create upon first startup?


Did you delete the contents inside the .atom directory? Or did you delete the entire directory? It looks like the code checks to see if the directory exists. If it doesn’t, then it creates the directory and its contents. If you delete the contents but leave the directory there … then the contents aren’t added. (I haven’t tested this but it makes sense given what you’re describing.)


I deleted the entire .atom directory before the execution.
Furthermore i added print commands to see if "fs.existsSync(@configDirPath)"
returned true. Strangely during the startup of the editor the .atom folder was created
before the execution of this function. Either that or somehow the synchronous check
if the folder exists is not synchronous.

The unittest in will not be run on a 32 bit system.
Currently i have this behaviour on windows 8 (64bit) running on a virtual machine.
I try to reproduce it on a PC, windows 10 (64bit). Is it possible that, due to previous installations,
a cached states is synced and the folder is created before the “initializedConfigDirectory()” is called?

describe ".initializeConfigDirectory()", ->
  beforeEach ->
    if fs.existsSync(dotAtomPath)

    atom.config.configDirPath = dotAtomPath

  afterEach ->

  describe "when the configDirPath doesn't exist", ->
    it "copies the contents of dot-atom to ~/.atom", ->
      return if process.platform is 'win32' # Flakey test on Win32
      initializationDone = false
      jasmine.unspy(window, "setTimeout")
      atom.config.initializeConfigDirectory ->
        initializationDone = true

      waitsFor -> initializationDone

      runs ->
        expect(fs.existsSync(path.join(atom.config.configDirPath, 'packages'))).toBeTruthy()
        expect(fs.isFileSync(path.join(atom.config.configDirPath, 'snippets.cson'))).toBeTruthy()
        expect(fs.isFileSync(path.join(atom.config.configDirPath, ''))).toBeTruthy()
        expect(fs.isFileSync(path.join(atom.config.configDirPath, 'styles.less'))).toBeTruthy()