@infinity-cli/ipublish 1.2.1 → 1.2.3

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.
@@ -11,7 +11,7 @@ declare const TypeBox_PublishConfig: import("@sinclair/typebox").TObject<{
11
11
  cmd: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
12
12
  cwd: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
13
13
  }>;
14
- export declare type Type_PublishConfig = Static<typeof TypeBox_PublishConfig>;
14
+ export type Type_PublishConfig = Static<typeof TypeBox_PublishConfig>;
15
15
  export declare const runtimeConfig: RuntimeConfig<{
16
16
  loginType?: "password" | "privateKey" | undefined;
17
17
  password?: string | undefined;
@@ -20,7 +20,7 @@ export declare const runtimeConfig: RuntimeConfig<{
20
20
  cwd?: string | undefined;
21
21
  ip: string;
22
22
  user: string;
23
- from: import("@sinclair/typebox").StaticArray<import("@sinclair/typebox").TString>;
23
+ from: string[];
24
24
  to: string;
25
25
  }>;
26
26
  export {};
@@ -13,13 +13,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.uploadRemoteAction = exports.uploadRemoteWithConfig = void 0;
16
- const config_1 = require("./config");
16
+ const shared_1 = require("@infinity-cli/shared");
17
17
  const node_ssh_1 = require("node-ssh");
18
+ const ora_1 = __importDefault(require("ora"));
18
19
  const path_1 = __importDefault(require("path"));
19
- const util_1 = require("../util");
20
- const shared_1 = require("@infinity-cli/shared");
21
20
  const rimraf_1 = __importDefault(require("rimraf"));
22
- const ora_1 = __importDefault(require("ora"));
21
+ const util_1 = require("../util");
22
+ const config_1 = require("./config");
23
23
  const uploadRemoteWithConfig = (config) => __awaiter(void 0, void 0, void 0, function* () {
24
24
  let spinner;
25
25
  const { ip, user, loginType, password, privateKey, from, to, cmd, cwd } = config;
@@ -84,8 +84,10 @@ const uploadRemoteWithConfig = (config) => __awaiter(void 0, void 0, void 0, fun
84
84
  cwd: cwd ? cwd : to,
85
85
  });
86
86
  result.stdout && console.log('STDOUT: ' + result.stdout);
87
- if (result.stderr) {
88
- console.error((0, shared_1.red)('STDERR: ' + result.stderr));
87
+ result.stderr && console.log('STDERR: ' + result.stderr);
88
+ if (result.code) {
89
+ console.error((0, shared_1.red)('Command failed with exit code: ' + result.code));
90
+ throw new Error(`Command failed: ${cmd}`);
89
91
  }
90
92
  }
91
93
  });
@@ -102,7 +104,7 @@ const uploadRemoteWithConfig = (config) => __awaiter(void 0, void 0, void 0, fun
102
104
  }
103
105
  });
104
106
  exports.uploadRemoteWithConfig = uploadRemoteWithConfig;
105
- const uploadRemoteAction = (LABEL_ENV, { config: configName } = { config: undefined }, { args } = { args: undefined }) => __awaiter(void 0, void 0, void 0, function* () {
107
+ const uploadRemoteAction = (LABEL_ENV_1, ...args_1) => __awaiter(void 0, [LABEL_ENV_1, ...args_1], void 0, function* (LABEL_ENV, { config: configName } = { config: undefined }, { args } = { args: undefined }) {
106
108
  const config = yield config_1.runtimeConfig.getConfig(args, configName, LABEL_ENV);
107
109
  if (!config.password && !config.privateKey) {
108
110
  console.error('password和privateKey至少设置一项');
@@ -0,0 +1 @@
1
+ {"root":["../src/bin.ts","../src/util.ts","../src/command/config.ts","../src/command/upload.ts","../src/lib/index.ts"],"version":"5.6.2"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infinity-cli/ipublish",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "license": "ISC",
5
5
  "description": "上传服务器文件",
6
6
  "main": "dist/lib/index.js",
@@ -27,13 +27,13 @@
27
27
  "infinity-cli"
28
28
  ],
29
29
  "dependencies": {
30
- "@infinity-cli/shared": "^1.2.1",
31
- "@sinclair/typebox": "^0.23.1",
30
+ "@infinity-cli/shared": "^1.2.2",
31
+ "@sinclair/typebox": "^0.33.12",
32
32
  "archiver": "^5.3.0",
33
33
  "commander": "^8.2.0",
34
34
  "node-ssh": "^12.0.3",
35
35
  "ora": "5",
36
36
  "rimraf": "^3.0.2"
37
37
  },
38
- "gitHead": "69a098d4ab1b328b595dcf88a3bda5a2be1a495d"
38
+ "gitHead": "2ad725ed52157bbde698356b225eb71d1dfabd7a"
39
39
  }