UNPKG

@atomist/automation-client

Version:

Atomist API for software low-level client

57 lines 2.51 kB
import * as fg from "fast-glob"; import { RepoRef } from "../../operations/common/RepoId"; import { File } from "../File"; import { FileStream, Project } from "../Project"; import { AbstractProject } from "../support/AbstractProject"; import { LocalProject, ReleaseFunction } from "./LocalProject"; export declare class NodeFsLocalProject extends AbstractProject implements LocalProject { private readonly cleanup; /** * Create a project from an existing directory. The directory must exist * @param {RepoRef} id * @param {string} baseDir * @param cleanup * @return {Promise<LocalProject>} */ static fromExistingDirectory(id: RepoRef, baseDir: string, cleanup?: ReleaseFunction): Promise<LocalProject>; /** * Copy the contents of the other project to this project * @param {Project} other * @param {string} baseDir * @param cleanup * @returns {LocalProject} */ static copy(other: Project, baseDir: string, cleanup?: ReleaseFunction): Promise<LocalProject>; /** * Base directory of the project on the local file system */ readonly baseDir: string; /** * Note: this does not validate existence of the target * directory, so using it except in tests should be avoided * @param {RepoRef} ident identification of the repo * @param {string} baseDir * @param cleanup function that will release locks, delete temp directories etc */ constructor(ident: RepoRef | string, baseDir: string, cleanup?: ReleaseFunction, shouldCache?: boolean); release(): Promise<void>; addFileSync(path: string, content: string): void; addFile(path: string, content: string): Promise<this>; addDirectory(path: string): Promise<this>; deleteDirectory(path: string): Promise<this>; deleteDirectorySync(path: string): void; deleteFileSync(path: string): void; deleteFile(path: string): Promise<this>; makeExecutable(path: string): Promise<this>; makeExecutableSync(path: string): void; directoryExistsSync(path: string): boolean; hasDirectory(path: string): Promise<boolean>; fileExistsSync(path: string): boolean; findFile(path: string): Promise<File>; getFile(path: string): Promise<File>; findFileSync(path: string): File; protected getFilesInternal(globPatterns: string[]): Promise<File[]>; streamFilesRaw(globPatterns: string[], opts: fg.Options): FileStream; private toRealPath; } //# sourceMappingURL=NodeFsLocalProject.d.ts.map