Skip to content

Commit c177aed

Browse files
committed
fix(proxy): build proxyList correctly
Also remove unnecessary `all` npm script.
1 parent b7930b2 commit c177aed

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"description": "The world's easiest, most powerful stock checker",
44
"main": "src/index.ts",
55
"scripts": {
6-
"all": "npm run compile && npm run lint && npm run test",
76
"fix": "gts fix",
87
"lint": "gts lint",
98
"clean": "gts clean",

src/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,15 @@ function envOrNumberMax(
158158
return number ?? 0;
159159
}
160160

161-
function loadProxyList(filename: string): string[] {
161+
function loadProxyList(filename: string): string[] | undefined {
162162
try {
163163
return readFileSync(`${filename}.proxies`)
164164
.toString()
165165
.trim()
166166
.split('\n')
167167
.map(x => x.trim());
168168
} catch {
169-
return [];
169+
return undefined;
170170
}
171171
}
172172

@@ -412,7 +412,7 @@ const store = {
412412

413413
let proxyList = loadProxyList(name);
414414

415-
if (proxyList.length === 0) {
415+
if (!proxyList) {
416416
proxyList = loadProxyList('global');
417417
}
418418

src/web/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
import {isAbsolute, join, normalize, relative} from 'path';
1212
import {logger} from '../logger';
1313

14-
const approot = join(__dirname, '../../../');
14+
const approot = join(__dirname, '../../');
1515
const webroot = join(approot, './web');
1616

1717
const contentTypeMap: Record<string, string> = {

0 commit comments

Comments
 (0)