Skip to content

retrieveCustomSite

retrieveCustomSite(connection, site, outputDirectory): Promise<string | undefined>

Defined in: retrieveCustomSite.ts:39

Retrieve a single CustomSite component by name into a destination directory.

Used when the site file isn’t found locally (see resolveSiteFile) but a --target-org connection is available — the fallback that lets the command work against a checkout that never had sites/ committed at all.

The component set is built directly from { fullName, type: 'CustomSite' } rather than resolved from source, since there’s nothing on disk yet for this component; merge: true is passed anyway so a same-named file elsewhere under outputDirectory gets merged into rather than duplicated, on the off chance the local search missed something the registry wouldn’t.

Connection

The org connection to retrieve from.

string

The CustomSite API name to retrieve.

string

Where to write the retrieved file, from resolveRetrieveDestination.

Promise<string | undefined>

The retrieved file’s path, or undefined if the org has no CustomSite by that name.

If the retrieve request or polling itself fails (auth, network, timeout) — only “the component doesn’t exist” is reported as undefined rather than thrown.