Updating Birch Packages

Continuing the discussion from Birch 1.0.0 “Dev” release:

The current process of updating Birch packages is very painful. It won’t be like this long term… long term you’ll get notified of updates automatically and be able to just click a button in the UI to update. The issue is that I don’t want to make these packages public yet, and so you need to do everything manually.

The apm install and apm link commands are full of mystery (at least they were for me not to long ago), but packages in Atom are really pretty simple.

In your home directory in Atoms hidden config folder there’s a packages folder. ~/.atom/packages. At startup Atom loads any packages that you have there. So in the end that’s what happens. If you want to add a package you can just copy it to that folder. Same with remove a package.

That’s the basic, now to complicate things:

  1. Atom packages can be enabled/disabled. If you copy a package to Atom’s packages folder and it doesn’t seem to be working go into Atom’s Settings > Packages, and make sure that package isn’t disabled.

  2. Most packages depend on other packages to get there work done. Inside each package is a package.json file that lists these dependencies along with other stuff. When you first download a package you need to change into into the package folder with Terminal.app and run apm install. That will download and build those dependencies.

  3. At this point you can just copy the package to ~/.atom/packages and it will be installed after an Atom restart. Or instead of manually copying the package to Atom’s packages folder you can use the apm link command. That creates a symbolic link from Atom’s packages directory to the package folder that you are in when you issue the command in Terminal.app. But I think this can run into problems if there’s already a folder with the same name in Atom’s packages folder.

I think for my my recommendation for update would be:

  1. Download new package.
  2. Make sure the package folder name is same as package, so for example if you download from git remove the trailing -master from the folder name.
  3. Inside that package folder run apm install.
  4. Then manually copy package into ~/.atom/packages.
  5. And then restart Atom.

I know it’s a mess… will get better eventually.