Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "spi/clone/CachingDirectoryManager"

Index

Type aliases

LockResult

Variables

Const AbsoluteAtomistWorkingDirectory

AbsoluteAtomistWorkingDirectory: string = path.join(os.homedir(), AtomistWorkingDirectory)

Const AtomistWorkingDirectory

AtomistWorkingDirectory: string = path.join(".atomist", "cache")

Const FallbackKey

FallbackKey: "directory_cache.fallback" = "directory_cache.fallback"

Const ReuseKey

ReuseKey: "directory_cache.reuse" = "directory_cache.reuse"

Const cache

cache: StableDirectoryManager = new StableDirectoryManager({reuseDirectories: true,baseDir: AbsoluteAtomistWorkingDirectory,cleanOnExit: false,})

Functions

incrementFallback

  • incrementFallback(owner: string, repo: string): void

incrementReuse

  • incrementReuse(owner: string, repo: string): void

keyFor

  • keyFor(owner: string, repo: string): string

pleaseLock

  • pleaseLock(lockPath: string): Promise<LockResult>

Object literals

Const CachingDirectoryManager

CachingDirectoryManager: object

Designed to accommodate occasional writes to the same repositories, this keeps one clone available for each repository. Every time that repository is requested, if that clone is available, we return it. (The caller gets to fetch, clean, etc. The directory could be dirty.) If that clone is locked by some other automation invocation, this DirectoryManager returns a temporary directory, and you get to clone into that.

If the returned CloneDirectoryInfo has type: "empty-directory" then the caller should clone into it (not from it, you're not in the parent directory). If it has type: "existing-directory" then fetch, clean, checkout etc. given it's already cloned.

type

{{directoryFor: ((owner: string, repo: string, branch: string, opts: CloneOptions) => Promise)}}

directoryFor

Generated using TypeDoc