jsii-release
Version:
Release jsii modules to multiple package managers
56 lines (55 loc) • 2.03 kB
TypeScript
export declare const DEFAULT_USAGE_DIR: string;
/**
* The usage directory is where we write per-session config files to access the CodeArtifact repository.
*
* Some config files may be written in a system-global location, but they will not be active unless the
* contents of this directory have been sourced/copied into the current terminal.
*
* CONTRACT
*
* There are two special entries:
*
* - `env`, a file with `key=value` entries for environment variables to set.
* - `cwd/`, a directory with files that need to be copied into the current directory before each command.
*
* Other than these, code may write tempfiles to this directory if it wants, but there is no meaning
* implied for other files.
*/
export declare class UsageDir {
readonly directory: string;
static default(): UsageDir;
readonly envFile: string;
readonly cwdDir: string;
private constructor();
delete(): Promise<void>;
/**
* Create a fresh empty directory, with helper scripts
*/
reset(): Promise<void>;
/**
* Set the expiration time of the current settings
*/
setExpirationTimeMs(timestamp: number): Promise<void>;
/**
* Add settings to the environment variables
*/
addToEnv(settings: Record<string, string>): Promise<void>;
/**
* Return the current environment variables
*/
currentEnv(): Promise<Record<string, string>>;
cwdFile(filename: string): string;
/**
* Activate in the current process (update process.env), copy the cwd/ directory to the current directory
*/
activateInCurrentProcess(): Promise<void>;
copySelectCwdFileHere(...filenames: string[]): Promise<void>;
putFile(filename: string, contents: string): Promise<string>;
putCwdFile(filename: string, contents: string): Promise<void>;
putJson(key: string, data: any): Promise<void>;
readJson<A>(key: string): Promise<A | undefined>;
/**
* Print to the console on how to activate these settings
*/
advertise(): void;
}