Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Repository

Stores data of a repository.

Hierarchy

  • Repository

Index

Constructors

constructor

  • new Repository(path: string, gitRevision: string): Repository

Properties

branch

branch: string

The name of the branch this repository is on right now.

files

files: string[] = []

A list of all files tracked by the repository.

gitHubProject

gitHubProject: string

The project name of this repository on GitHub.

gitHubUser

gitHubUser: string

The user/organisation name of this repository on GitHub.

path

path: string

The root path of this repository.

Methods

contains

  • contains(fileName: string): boolean
  • Check whether the given file is tracked by this repository.

    Parameters

    • fileName: string

      The name of the file to test for.

    Returns boolean

    TRUE when the file is part of the repository, otherwise FALSE.

getGitHubURL

  • getGitHubURL(fileName: string): string
  • Get the URL of the given file on GitHub.

    Parameters

    • fileName: string

      The file whose GitHub URL should be determined.

    Returns string

    An url pointing to the web preview of the given file or NULL.

Static tryCreateRepository

  • tryCreateRepository(path: string, gitRevision: string): Repository
  • Try to create a new repository instance.

    Checks whether the given path is the root of a valid repository and if so creates a new instance of Repository.

    Parameters

    • path: string

      The potential repository root.

    • gitRevision: string

    Returns Repository

    A new instance of Repository or NULL.

Generated using TypeDoc