Comments (6)
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 service
s to be rm
ed.
@Steveb-p Thoughts/Comments?
from docker-compose.
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.
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.
I would prefer the destructuring approach.
from docker-compose.
There were not tests against rm
function actually. Also, commandOptions
have to have "-s"
, otherwise running containers will not be stopped.
from docker-compose.
@Steveb-p thanks for your PR. 📦 [email protected] is released on npm.
from docker-compose.
Related Issues (20)
- the down method doesn't appear to work HOT 15
- Error running commands on Electron HOT 1
- Add a way to get progress report
- doubt docker-compose HOT 5
- Cannot create a string longer than 0x1fffffe8 characters HOT 9
- Error running docker-compose HOT 5
- adding a option to set COMPOSE_HTTP_TIMEOUT variable HOT 2
- spawn docker-compose ENOENT on Gitlab CI HOT 1
- rm and stopMany methods have an inconsistent API HOT 10
- How to use npm package docker-compose inside an active container? HOT 5
- ps doesn't output all services -> offset of 1 service HOT 1
- Output ends up in "err" instead of "out" on macos even when exitCode equals 0 HOT 8
- execCompose can throw "RangeError: Invalid string length" HOT 1
- Down options like downOne and downMany HOT 3
- Version 0.24.4 broke packages using that dependency HOT 1
- Support for docker compose watch HOT 3
- integration of list commands HOT 2
- passing env object causes issues HOT 2
- Improve detection if "--detach" should be set HOT 2
- Docker-Compose V2 && ESM + TypeScript HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-compose.