Git Product home page Git Product logo

Comments (6)

AlexZeitler avatar AlexZeitler commented on July 29, 2024

@MOTORIST 👋

Did you try putting the service name at the last entry of options.commandOptions?
If this doesn't do the trick:

Would you mind sending a PR including a test?

container should be service

export const rm = function (options?: IDockerComposeOptions, service?: string): Promise<IDockerComposeResult>;

Maybe it might make sense to allow 1..n services to be rmed.

@Steveb-p Thoughts/Comments?

from docker-compose.

Steveb-p avatar Steveb-p commented on July 29, 2024

Sure, why not.

export const rm = function (options?: IDockerComposeOptions, ...services: string[]): Promise<IDockerComposeResult>;

or

export const rm = function (options?: IDockerComposeOptions, services: string | string[]): Promise<IDockerComposeResult>;

or

export const rm = function (options?: IDockerComposeOptions, services: string[]): Promise<IDockerComposeResult>;

depending on your preference.

Destructuring seems more docker-compose-like. Allows passing a single-string service or multiple without requiring internal type checks in function. All we will need to check is if services.length > 0.

from docker-compose.

MOTORIST avatar MOTORIST commented on July 29, 2024

Did you try putting the service name at the last entry of options.commandOptions

No, this not expected behavior

Maybe?

export const rmOne = function (service: string, options?: IDockerComposeOptions): Promise<IDockerComposeResult>

@Steveb-p suggested a more flexible solution.

from docker-compose.

AlexZeitler avatar AlexZeitler commented on July 29, 2024

I would prefer the destructuring approach.

from docker-compose.

Steveb-p avatar Steveb-p commented on July 29, 2024

There were not tests against rm function actually. Also, commandOptions have to have "-s", otherwise running containers will not be stopped.

from docker-compose.

AlexZeitler avatar AlexZeitler commented on July 29, 2024

@Steveb-p thanks for your PR. 📦 [email protected] is released on npm.

from docker-compose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.