@whyour/qinglong 0.15.2 → 0.15.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whyour/qinglong",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "description": "Timed task management platform supporting Python3, JavaScript, Shell, Typescript",
5
5
  "repository": {
6
6
  "type": "git",
@@ -142,13 +142,16 @@ let SystemService = class SystemService {
142
142
  return { code: 200, data: info };
143
143
  }
144
144
  async updateLinuxMirror(info, res, onEnd) {
145
- var _a;
146
145
  const oDoc = await this.getSystemConfig();
147
146
  await this.updateAuthDb(Object.assign(Object.assign({}, oDoc), { info: Object.assign(Object.assign({}, oDoc.info), info) }));
148
147
  let defaultDomain = 'http://deb.debian.org';
149
148
  let targetDomain = 'http://deb.debian.org';
150
- if ((_a = oDoc.info) === null || _a === void 0 ? void 0 : _a.linuxMirror) {
151
- defaultDomain = oDoc.info.linuxMirror;
149
+ const content = await fs_1.default.promises.readFile('/etc/apt/sources.list', {
150
+ encoding: 'utf-8',
151
+ });
152
+ const domainMatch = content.match(/(http.*)\/debian /);
153
+ if (domainMatch) {
154
+ defaultDomain = domainMatch[1];
152
155
  }
153
156
  if (info.linuxMirror) {
154
157
  targetDomain = info.linuxMirror;