ramm 0.0.58 → 0.0.59

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.
package/dist/ramm.js CHANGED
@@ -399,26 +399,38 @@ var getCreateCommand = async (name) => {
399
399
  var loginPodman = async (address, login, password) => {
400
400
  return await execCommand(`echo "${password}" | podman login --username "${login}" --password-stdin ${address}`);
401
401
  };
402
- var createPodmanCommand = (props) => {
402
+ var createPodmanCommand = ({
403
+ name,
404
+ replace = true,
405
+ background = true,
406
+ networks = ["ramm"],
407
+ envs = [],
408
+ volumes = [],
409
+ command
410
+ }) => {
403
411
  const values = [];
404
- if (props.name) {
405
- values.push(`--name ${props.name}`);
412
+ values.push("podman", "run");
413
+ if (name) {
414
+ values.push(`--name ${name}`);
406
415
  }
407
- if (props.replace) {
416
+ if (replace) {
408
417
  values.push("--replace");
409
418
  }
410
- if (props.background) {
419
+ if (background) {
411
420
  values.push("-d");
412
421
  }
413
- if (props.network) {
414
- values.push(`--network ${props.network}`);
422
+ for (const network of networks) {
423
+ values.push(`--network ${network}`);
415
424
  }
416
- for (const env of props.envs ?? []) {
425
+ for (const env of envs) {
417
426
  values.push(`-e ${env.name}=${env.value}`);
418
427
  }
419
- for (const volume of props.volumes ?? []) {
428
+ for (const volume of volumes) {
420
429
  values.push(`-v ${volume.from}:${volume.to}`);
421
430
  }
431
+ values.push(command);
432
+ const str = values.join(" ");
433
+ return str;
422
434
  };
423
435
  var runPodmanContainer = async (name, command) => {
424
436
  if (await getCreateCommand(name) !== command) {
@@ -5,11 +5,11 @@ export declare const loginPodman: (address: string, login: string, password: str
5
5
  stdout: string;
6
6
  spawnResult: import("bun").Subprocess<"inherit", "pipe", "pipe">;
7
7
  }>;
8
- export declare const createPodmanCommand: (props: {
8
+ export declare const createPodmanCommand: ({ name, replace, background, networks, envs, volumes, command, }: {
9
9
  name?: string;
10
10
  replace?: boolean;
11
11
  background?: boolean;
12
- network?: string;
12
+ networks?: string[];
13
13
  envs?: {
14
14
  name: string;
15
15
  value: string;
@@ -19,7 +19,7 @@ export declare const createPodmanCommand: (props: {
19
19
  to: string;
20
20
  }[];
21
21
  command: string;
22
- }) => void;
22
+ }) => string;
23
23
  export declare const runPodmanContainer: (name: string, command: string) => Promise<void>;
24
24
  export declare const runPodmanContainerService: (name: string, command: string, context?: Context) => Promise<void>;
25
25
  export declare const addNftPodmanRule: () => Promise<void>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ramm",
3
3
  "type": "module",
4
- "version": "0.0.58",
4
+ "version": "0.0.59",
5
5
  "scripts": {
6
6
  "build": "bun build ./src/ramm.ts --target bun --outdir ./dist && cp ./src/bun.sh ./dist/bun.sh",
7
7
  "types": "tsc --project tsconfig.types.json"