← All procedures

git.hasChanges

Check if there are any changes (unstaged, staged, or untracked)

CLI
Package
@procedures/git · README
Path
["git","hasChanges"]
CLI
mark git hasChanges
As data
{"$proc":["git","hasChanges"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/git"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["git","hasChanges"], {});
console.log(JSON.stringify(result));

From the command line

$ mark git hasChanges

As data, in a program

{ "$proc": ["git", "hasChanges"], "input": {} }

Input

FieldTypeRequiredDefaultDescription
cwdstringnoWorking directory (default: process.cwd())

Output

FieldTypeRequiredDefaultDescription
valuebooleanyesThe answer of the predicate
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "cwd": {
        "description": "Working directory (default: process.cwd())",
        "type": "string"
      }
    }
  },
  "output": {
    "type": "object",
    "properties": {
      "value": {
        "type": "boolean",
        "description": "The answer of the predicate"
      }
    },
    "required": [
      "value"
    ],
    "additionalProperties": {}
  }
}