@cloud-cli/dx 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@ interface GetLogsOptions {
6
6
  export declare function getLogs({ name, lines }: GetLogsOptions): Promise<string>;
7
7
  interface RunOptions {
8
8
  name: string;
9
- env?: string[];
9
+ env?: string[] | string;
10
10
  ports?: string;
11
11
  }
12
12
  export declare function startContainer(options: RunOptions): Promise<boolean>;
@@ -29,6 +29,9 @@ export async function startContainer(options) {
29
29
  throw new Error('Name is required');
30
30
  }
31
31
  const env = [];
32
+ if (typeof options.env === 'string') {
33
+ options.env = [options.env];
34
+ }
32
35
  if (Array.isArray(options.env)) {
33
36
  env.push(...options.env.flatMap((e) => ['-e', e]));
34
37
  }
@@ -38,7 +41,6 @@ export async function startContainer(options) {
38
41
  const extraPorts = addExecFlag(options.ports, 'p');
39
42
  await exec('docker', [
40
43
  'run',
41
- '--rm',
42
44
  '--detach',
43
45
  '--restart',
44
46
  'always',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud-cli/dx",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Docker container management",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",