@cloud-cli/dx 1.5.0 → 1.5.1

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 @@ export async function getRunningContainers() {
6
6
  if (!ps.ok) {
7
7
  throw new Error('Failed to list containers: ' + ps.stderr);
8
8
  }
9
- return getListFromString(ps.stdout);
9
+ return getListFromString(ps.stdout).sort();
10
10
  }
11
11
  export async function getLogs({ name, lines }) {
12
12
  if (!name) {
@@ -27,7 +27,10 @@ export async function startAll(_, cli) {
27
27
  const running = await getRunningContainers();
28
28
  const notRunning = list.filter(({ name }) => !running.includes(name));
29
29
  for (const app of notRunning) {
30
- await refreshContainer({ name: app.name }, cli);
30
+ try {
31
+ await refreshContainer({ name: app.name }, cli);
32
+ }
33
+ catch { }
31
34
  }
32
35
  return true;
33
36
  }
package/dist/store.js CHANGED
@@ -84,7 +84,8 @@ export async function updateContainer(options) {
84
84
  return container;
85
85
  }
86
86
  export async function listContainers() {
87
- return Resource.find(Container, new Query());
87
+ const list = await Resource.find(Container, new Query());
88
+ return list.sort((a, b) => Number(a.name > b.name) || -1);
88
89
  }
89
90
  export async function findContainer(name) {
90
91
  const found = await Resource.find(Container, new Query().where('name').is(name));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud-cli/dx",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Docker container management",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",