rush-git-lfs-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.3.4 • Public • Published

rush-git-lfs-plugin

A rush plugin that can check if files are correctly managed by Git LFS.

Prerequisite

Rush.js >= 5.83.2

Quick Start

  1. Enabling this rush plugin

Please follow the official doc to enable this plugin in your repo.

  1. Running git-lfs-check command
# auto detect changed files by "git diff"
rush git-lfs-check

# or you can specify the files that need to be check\
rush git-lfs-check --file <my_file_name>

# you can add --fix option to auto fix incorrect lfs status

Configuration

You can specify which paths should be checked by provided a set of glob patterns and the size threshold can be customized.

JSON Schema For configuration

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Configuration for Rush Git LFS plugin",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "type": "string",
      "default": "http://json-schema.org/draft-04/schema#"
    },
    "checkPattern": {
      "description": "Glob patterns that need to check",
      "patternProperties": {
        "^.+$": {
          "type": "string",
          "description": "Customized size threshold for this pattern."
        }
      }
    },
    "errorTips": {
      "type": "string",
      "description": "Tips that shown while there are check errors"
    }
  }
}

Example Configurations

  • Ban all png and dll files
    {
      "checkPattern": {
        "**/*.png": -1,
        "**/*.dll": -1
      },
    }
  • Ban all files that larger than 5MB
    {
      "checkPattern": {
        "**/*": 5 * 1024 * 124,
      },
    }
  • Ban files in particular folder
    {
      "checkPattern": {
        "**/some_folder_path": -1,
      },
    }

Package Sidebar

Install

npm i rush-git-lfs-plugin

Weekly Downloads

44

Version

0.3.4

License

MIT

Unpacked Size

86.6 kB

Total Files

80

Last publish

Collaborators

  • escapeb
  • chengcyber
  • tiktok-service