Skip to content

Support running a custom script before adding and committing #331

@Xiphe

Description

@Xiphe

I would really like to execute manual cleanup after new files have been copied but before everything is added.

Ideally I could just hook in a function that receives the git instance.

API proposal

lib

var ghpages = require('gh-pages');
var getOutdatedBranches = require('./complexCleanupStep');

ghpages.publish(
  'dist',
  {
    async beforeAdd(git) {
        git.rm(await getOutdatedBranches());
    }
  },
  (err) => { /*...*/ }
);

cli

gh-pages --beforeAdd="./myCustomScript.js"

Let me know what you think about this. I'd happily submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions