git-flush
Version:
Commits and pushes if repository is dirty. Does nothing otherwise.
23 lines • 859 B
TypeScript
/** @module git-flush
*/
declare module "git-flush" {
/**
* @typedef {Object} Options
* @prop {string} directory Path to the git repository
* @prop {boolean} push
*/
export type Options = {
directory: string;
push: boolean;
};
/**
* If repository is dirty, the changes will be stashed, commited and optionally pushed. If repository is clean, does nothing.
* @param {string} [message="Commit from script"]
* @param {Options} [options={}]
* @returns {Promise<null|number>} `null` if directory is not a git repository, `number` of commit changes if directory is a git repository
* @example
* import gitFlush from "git-flush"
* const result = await gitFlush("Commit message")
*/
export default function(message?: string, options?: Options): Promise<null | number>;
}