# new TemplateSync(args)
This class provides functionality to download and update various project files and configurations from a remote repository. It supports updating licenses, IDE configurations, scripts, styles, documentation, workflows, and templates.
A command-line tool for synchronizing project templates and configurations.
Parameters:
Name | Type | Description |
---|---|---|
args |
CommandOptions
|
The command options for TemplateSync |
Extends
Members
Methods
# async protected checkRequirements() → {Promise.<void>}
Retrieves the list of dependencies and compares it against the required dependencies for the command.
Checks if all required dependencies are present.
- Overrides:
A promise that resolves when the check is complete.
Promise.<void>
# async downloadOption(key) → {Promise.<void>}
This method downloads all files associated with a given option key from the remote repository.
Downloads files for a specific option category.
Parameters:
Name | Type | Description |
---|---|---|
key |
string
|
The key representing the option category to download |
If the specified option key is not found
Error
Promise.<void>
# async execute() → {Promise.<(R|string|void)>}
This method handles the overall execution flow of the command, including parsing arguments, setting up logging, checking for version or help requests, and running the command.
Executes the command.
- Overrides:
A promise that resolves with the command's result.
Promise.<(R|string|void)>
# async getIde() → {Promise.<void>}
Downloads IDE configuration files.
Downloads IDE configuration files.
Promise.<void>
# async getLicense(license) → {Promise.<void>}
This method downloads the chosen license file, saves it to the project, and updates the package.json license field.
Downloads and sets up the specified license.
Parameters:
Name | Type | Description |
---|---|---|
license |
"MIT"
|
"GPL"
|
"Apache"
|
"LGPL"
|
"AGPL"
|
The license to download and set up |
Promise.<void>
# protected help(args) → {void}
This method should be overridden in derived classes to provide specific help information.
Provides help information for the command.
Parameters:
Name | Type | Description |
---|---|---|
args |
ParseArgsResult
|
The parsed command-line arguments. |
- Overrides:
void
# async run(args) → {Promise.<void>}
This method orchestrates the downloading of various project components based on the provided arguments.
Runs the template synchronization process.
Parameters:
Name | Type | Description |
---|---|---|
args |
ParseArgsResult
|
The parsed command-line arguments |
- Overrides:
Promise.<void>