@shun-js/shun-cli 0.0.6 → 0.0.8

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/README.md CHANGED
@@ -1,3 +1,19 @@
1
- ## @shun-js/shun-cli
1
+ # @shun-js/shun-cli
2
2
 
3
3
  shun.js cli tool
4
+
5
+ ## 安装
6
+
7
+ ```shell
8
+ npm i -g @shun-js/shun-cli
9
+ ```
10
+
11
+ ## 启动服务
12
+
13
+ ```shell
14
+ # 启动,在feishu-grafana-alert.json所在目录下
15
+ shunjs start @shun-js/feishu-grafana-alert
16
+
17
+ # 可以启动多个服务
18
+ shunjs start @shun-js/feishu-grafana-alert @shun-js/xxx
19
+ ```
package/bin/shun-start.js CHANGED
@@ -42,8 +42,10 @@ async function startServer(serverName) {
42
42
 
43
43
  // check package
44
44
  const npmGlobalPath = getNPMGlobalPath();
45
- const serverAppPath = path.resolve(npmGlobalPath, `./${serverName}/app.js`);
45
+ const serverRootPath = path.resolve(npmGlobalPath, `./${serverName}`);
46
+ const serverAppPath = path.resolve(serverRootPath, './app.js');
46
47
  const serverAppPathIsExists = await isExists(serverAppPath);
48
+ debug(methodName, 'serverRootPath', serverRootPath);
47
49
  debug(methodName, 'serverAppPath', serverAppPath);
48
50
  debug(methodName, 'serverAppPathIsExists', serverAppPathIsExists);
49
51
  if (!serverAppPathIsExists) {
@@ -64,6 +66,7 @@ async function startServer(serverName) {
64
66
  try {
65
67
  await pm2Start({
66
68
  name: serverConfigPrefix,
69
+ cwd: serverRootPath,
67
70
  script: serverAppPath,
68
71
  args: serverConfigPath,
69
72
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shun-js/shun-cli",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "shun.js cli",
5
5
  "files": [
6
6
  "bin",
@@ -19,5 +19,5 @@
19
19
  "access": "public",
20
20
  "registry": "https://registry.npmjs.org/"
21
21
  },
22
- "gitHead": "262d9beee75cdb725ab88b60ed600af8e6bc4dfd"
22
+ "gitHead": "ca031dd92fc3cd4e1c402e9fb73fd19540e84ee3"
23
23
  }