@whyour/qinglong 0.6.1 → 0.7.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whyour/qinglong",
3
- "version": "0.6.1",
3
+ "version": "0.7.1",
4
4
  "description": "Timed task management platform supporting Python3, JavaScript, Shell, Typescript",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,7 +13,7 @@ const client = new health_1.HealthClient(`localhost:${config_1.default.cronPort}
13
13
  app.get('/api/health', (req, res) => {
14
14
  client.check({ service: 'cron' }, (err, response) => {
15
15
  if (err) {
16
- return res.status(500).send({ code: 500, error: err });
16
+ return res.status(200).send({ code: 500, error: err });
17
17
  }
18
18
  return res.status(200).send({ code: 200, data: response });
19
19
  });
@@ -138,7 +138,7 @@ let DependenceService = class DependenceService {
138
138
  const socketMessageType = isInstall
139
139
  ? 'installDependence'
140
140
  : 'uninstallDependence';
141
- const depName = dependency.name.trim();
141
+ let depName = dependency.name.trim();
142
142
  const depRunCommand = (isInstall
143
143
  ? dependence_1.InstallDependenceCommandTypes
144
144
  : dependence_1.unInstallDependenceCommandTypes)[dependency.type];
@@ -155,22 +155,28 @@ let DependenceService = class DependenceService {
155
155
  if (isInstall) {
156
156
  const getCommandPrefix = dependence_1.GetDependenceCommandTypes[dependency.type];
157
157
  const depVersionStr = dependence_1.versionDependenceCommandTypes[dependency.type];
158
- const [_depName, _depVersion] = dependency.name
159
- .trim()
160
- .split(depVersionStr);
158
+ let depVersion = '';
159
+ if (depName.includes(depVersionStr)) {
160
+ const symbolRegx = new RegExp(`(.*)${depVersionStr}([0-9\\.\\-\\+a-zA-Z]*)`);
161
+ const [, _depName, _depVersion] = depName.match(symbolRegx) || [];
162
+ if (_depVersion && _depName) {
163
+ depName = _depName;
164
+ depVersion = _depVersion;
165
+ }
166
+ }
161
167
  const isNodeDependence = dependency.type === dependence_1.DependenceTypes.nodejs;
162
168
  const isLinuxDependence = dependency.type === dependence_1.DependenceTypes.linux;
163
169
  const isPythonDependence = dependency.type === dependence_1.DependenceTypes.python3;
164
170
  const depInfo = (await (0, util_1.promiseExecSuccess)(isNodeDependence
165
- ? `${getCommandPrefix} | grep "${_depName}" | head -1`
166
- : `${getCommandPrefix} ${_depName}`)).replace(/\s{2,}/, ' ');
171
+ ? `${getCommandPrefix} | grep "${depName}" | head -1`
172
+ : `${getCommandPrefix} ${depName}`)).replace(/\s{2,}/, ' ');
167
173
  if (depInfo &&
168
- ((isNodeDependence && ((_a = depInfo.split(' ')) === null || _a === void 0 ? void 0 : _a[0]) === _depName) ||
174
+ ((isNodeDependence && ((_a = depInfo.split(' ')) === null || _a === void 0 ? void 0 : _a[0]) === depName) ||
169
175
  (isLinuxDependence && depInfo.toLocaleLowerCase().includes('installed')) ||
170
176
  isPythonDependence) &&
171
- (!_depVersion || depInfo.includes(_depVersion))) {
177
+ (!depVersion || depInfo.includes(depVersion))) {
172
178
  const endTime = (0, dayjs_1.default)();
173
- const _message = `检测到已经安装 ${_depName}\n\n${depInfo}\n跳过安装\n\n依赖${actionText}成功,结束时间 ${endTime.format('YYYY-MM-DD HH:mm:ss')},耗时 ${endTime.diff(startTime, 'second')} 秒`;
179
+ const _message = `检测到已经安装 ${depName}\n\n${depInfo}\n跳过安装\n\n依赖${actionText}成功,结束时间 ${endTime.format('YYYY-MM-DD HH:mm:ss')},耗时 ${endTime.diff(startTime, 'second')} 秒`;
174
180
  this.sockService.sendMessage({
175
181
  type: socketMessageType,
176
182
  message: _message,
@@ -181,7 +187,7 @@ let DependenceService = class DependenceService {
181
187
  return resolve(null);
182
188
  }
183
189
  }
184
- const cp = (0, cross_spawn_1.spawn)(`${depRunCommand} ${depName}`, {
190
+ const cp = (0, cross_spawn_1.spawn)(`${depRunCommand} ${dependency.name.trim()}`, {
185
191
  shell: '/bin/bash',
186
192
  });
187
193
  cp.stdout.on('data', async (data) => {
package/version.yaml CHANGED
@@ -1,7 +1,6 @@
1
- version: 2.15.19
2
- changeLogLink: https://t.me/jiao_long/385
3
- publishTime: 2023-07-20 23:59
1
+ version: 2.15.20
2
+ changeLogLink: https://t.me/jiao_long/386
3
+ publishTime: 2023-07-22 16:00
4
4
  changeLog: |
5
- 1. 通知支持 pushMe
6
- 2. 修复系统通知设置保存失败
7
- 3. 修复判断依赖已安装逻辑
5
+ 1. 修复判断 linux 依赖已安装逻辑
6
+ 2. 修复未启动完成时,页面提示 500