@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
|
@@ -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
|
-
|
|
151
|
-
|
|
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;
|