@abtnode/router-provider 1.16.34-beta-20241207-134904-3c3d9a35 → 1.16.34-beta-20241212-094401-992d20c3
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/lib/index.js +17 -0
- package/package.json +6 -6
package/lib/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-await-in-loop */
|
|
2
2
|
|
|
3
3
|
const kill = require('fkill');
|
|
4
|
+
const promiseSpawn = require('@abtnode/util/lib/promise-spawn');
|
|
4
5
|
/* eslint-disable no-restricted-syntax, global-require */
|
|
5
6
|
const logger = require('@abtnode/logger')(`${require('../package.json').name}:provider:index`);
|
|
6
7
|
/* eslint-disable import/order */
|
|
@@ -84,7 +85,23 @@ const clearRouterByConfigKeyword = async (keyword) => {
|
|
|
84
85
|
return '';
|
|
85
86
|
};
|
|
86
87
|
|
|
88
|
+
const checkDockerInstalled = async () => {
|
|
89
|
+
try {
|
|
90
|
+
await promiseSpawn('docker --version');
|
|
91
|
+
await promiseSpawn('docker ps -a');
|
|
92
|
+
return true;
|
|
93
|
+
} catch (_) {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const clearDockerContainer = async () => {
|
|
99
|
+
await promiseSpawn('docker rm -f $(docker ps -q --filter "name=^blocklet-")');
|
|
100
|
+
};
|
|
101
|
+
|
|
87
102
|
module.exports = {
|
|
103
|
+
checkDockerInstalled,
|
|
104
|
+
clearDockerContainer,
|
|
88
105
|
clearRouterByConfigKeyword,
|
|
89
106
|
findExistsProvider,
|
|
90
107
|
getProvider,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/router-provider",
|
|
3
|
-
"version": "1.16.34-beta-
|
|
3
|
+
"version": "1.16.34-beta-20241212-094401-992d20c3",
|
|
4
4
|
"description": "Routing engine implementations for abt node",
|
|
5
5
|
"author": "polunzh <polunzh@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/ArcBlock/blocklet-server#readme",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"url": "https://github.com/ArcBlock/blocklet-server/issues"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@abtnode/constant": "1.16.34-beta-
|
|
36
|
-
"@abtnode/logger": "1.16.34-beta-
|
|
37
|
-
"@abtnode/router-templates": "1.16.34-beta-
|
|
38
|
-
"@abtnode/util": "1.16.34-beta-
|
|
35
|
+
"@abtnode/constant": "1.16.34-beta-20241212-094401-992d20c3",
|
|
36
|
+
"@abtnode/logger": "1.16.34-beta-20241212-094401-992d20c3",
|
|
37
|
+
"@abtnode/router-templates": "1.16.34-beta-20241212-094401-992d20c3",
|
|
38
|
+
"@abtnode/util": "1.16.34-beta-20241212-094401-992d20c3",
|
|
39
39
|
"@arcblock/http-proxy": "^1.19.1",
|
|
40
40
|
"@arcblock/is-valid-domain": "^1.0.5",
|
|
41
41
|
"axios": "^1.7.5",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"bluebird": "^3.7.2",
|
|
60
60
|
"fs-extra": "^11.2.0"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "b7f48fbd0fa4c1b5626a501a860701879be1c7b9"
|
|
63
63
|
}
|