kist
Version:
Package Pipeline Processor
43 lines (42 loc) • 1.72 kB
TypeScript
import { Action } from "../../core/pipeline/Action";
import { ActionOptionsType } from "../../types/ActionOptionsType";
/**
* FileCopyAction is a step action responsible for copying files from a source
* location to a destination directory. This action handles file path
* resolution and ensures that existing files in the destination can be
* replaced if necessary.
*/
export declare class FileCopyAction extends Action {
/**
* Executes the file copy action.
* @param options - The options specific to file copying, including source
* file and destination directory.
* @returns A Promise that resolves when the file has been successfully
* copied, or rejects with an error if the action fails.
*/
execute(options: ActionOptionsType): Promise<void>;
/**
* Copies a file from a specified source to a destination directory.
* Handles file path resolution and ensures the destination directory
* exists.
*
* @param srcFile - The path of the source file to be copied.
* @param destDir - The destination directory where the file should
* be placed.
* @returns A Promise that resolves when the file has been successfully
* copied.
* @throws {Error} If the file cannot be copied, including due to
* permission errors or the source file not existing.
*/
private copyFileToDirectory;
/**
* Ensures that the given directory exists, creating it if it does not.
* @param dirPath - The path of the directory to check and create.
*/
private ensureDirectoryExists;
/**
* Provides a description of the action.
* @returns A string description of the action.
*/
describe(): string;
}