update/updater-appveyor

Replaces custom template upon update

phated opened this issue · 1 comments

It looks like it ignores my custom template when the appveyor.yml file already exists.

doowb commented

As I'm looking into this and how updater-travis handles it, it seems like we need more options for it.

Right now, when the appveyor.yml or .travis.yml files exists in the current project, the updaters, read that file and update the contents based on the node version specified in the package.json. Since those files aren't coming from a templates directory (like they do when creating a new file) the custom template logic isn't triggered.

I can see a couple of different paths to take here:

  1. when update appveyor is run and an appveyor.yml exists in the cwd
    • check if a custom template is available and replace the contents
    • otherwise, run current update logic
  2. create a new task to replace the current appveyor.yml file with the custom template
    • update appveyor:replace
  3. make the default task do the replace, create a new task to update an existing appveyor.yml ignoring the custom template
    • update appveyor:update

I like 1 the best and providing information that the custom template is being used will be useful for when people like me forget that I created a custom template.

To make it easier for updaters to access the custom template directory, we can provide a method on app to get it (if it's not already there).