Class WpPackage

Represents a WordPress package that can be installed and configured.

Hierarchy

Constructors

Properties

destFolder: string

the destination folder

packageType: string

the package type

pkgInfo: WordpressPkg

the package info

tempDir: string

the temporary directory

Methods

  • Asynchronously clones a repository from a given URL to a specified directory.

    Parameters

    • packageUrl: string

      The URL of the repository to clone.

    Returns Promise<unknown>

    A promise that resolves to the path of the cloned package on success, or rejects with an error on failure.

  • Downloads a package from a given URL and saves it to the target directory.

    Parameters

    • packageUrl: string

      The URL of the package to download.

    Returns Promise<void>

    A promise that resolves when the package is successfully downloaded and saved, or rejects with an error.

  • Downloads a file from a given URL and extracts it to a specified destination.

    Parameters

    • filename: string

      The name of the file to be downloaded.

    • downloadUrl: string

      The URL from which the file will be downloaded.

    Returns Promise<string>

    A promise that resolves when the file is downloaded and extracted successfully.

  • Gets the destination folder based on the package type.

    Parameters

    • paths: WPMMpaths

      An array of paths.

    • packageType: string

      The type of package ('plugin' or 'theme').

    Returns string

    The destination folder path.

  • This is a method that retrieves the version of the current package.

    No parameters are needed for this method.

    Returns {
        version: undefined | string;
    }

    Returns an object with the version of the current package.

    • version: undefined | string
  • Installs WordPress and sets up the WordPress configuration.

    Returns Promise<void>

    A Promise that resolves when the installation and configuration are complete.

  • Installs WordPress with the specified version and language.

    Parameters

    • version: undefined | string = 'latest'

      The version of WordPress to install.

    • language: undefined | string = 'en_US'

      The language of WordPress to install.

    Returns Promise<void>

  • Sets up the WordPress configuration by copying the sample config file, replacing the placeholder values with the actual configuration values, and saving the updated config file.

    Returns Promise<void>

    This function does not return anything.

Generated using TypeDoc