Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor!: expand run command parameters #131

Open
KyleTryon opened this issue Sep 1, 2022 · 1 comment
Open

Refactor!: expand run command parameters #131

KyleTryon opened this issue Sep 1, 2022 · 1 comment
Labels
backlog good first issue Good for newcomers help wanted Extra attention is needed

Comments

@KyleTryon
Copy link
Contributor

Currently, the constructor for the Run native command takes in a singular argument RunParameters, which is an object containing all possible parameters of the Run command.

While the singular argument for parameters in the constructor is preferred, we should expand the internal properties.

https://github.com/CircleCI-Public/circleci-config-sdk-ts/blob/main/src/lib/Components/Commands/exports/Native/Run.ts#L20

constructor(parameters: RunParameters) {
    this.parameters = parameters;
  }

This should be expanded into this instead.

/**
   * Command to run via the shell
   */
  command: StringParameter;
  /**
   * Shell to use for execution command (default: See Default Shell Options)
   */
  shell?: StringParameter;
...
@KyleTryon KyleTryon added good first issue Good for newcomers help wanted Extra attention is needed labels Sep 1, 2022
@batovpasha
Copy link

@KyleTryon Hello!
I want to clarify one moment. Do you mean we need to destructure all properties from the parameters parameter and assign each of them to an own this class property?
For example:

constructor(parameters: RunParameters) {
    const {shell, command} = parameters;

    this.shell = shell;
    this.command = command;
    // Other properties
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants