Nonchalant Programming Master

    is-git-status-clean

    1.0.0 • Public • Published

    is-git-status-clean Build Status

    Check if the git working directory is clean

    Install

    npm install is-git-status-clean
    

    or

    yarn add is-git-status-clean
    

    Usage

    const isGitStatusClean = require('is-git-status-clean')
     
    console.log(isGitStatusClean())
    //=> true or false

    or from the console

    $ is-git-status-clean && [command]
    

    API

    isGitStatusClean()

    Returns true if there are no edited, untracked or staged files in the working directory, or false if the contrary.

    CLI

    You can use is-git-status-clean from your npm scripts to prevent a publish if the working directory is dirty.

    In your package.json:

    "scripts": {
        "deploy":  "is-git-status-clean && [command]",
    

    or even

    "scripts": {
        "prepublish":  "is-git-status-clean",
    

    License

    MIT © Marco Fugaro

    Install

    npm i is-git-status-clean

    DownloadsWeekly Downloads

    25

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    3.41 kB

    Total Files

    6

    Last publish

    Collaborators

    • marcofugaro