Skip to content

Commit

Permalink
fix: bin for v2ray
Browse files Browse the repository at this point in the history
  • Loading branch information
geekdada committed Sep 2, 2019
1 parent c4ad444 commit fb2e4b9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
23 changes: 15 additions & 8 deletions lib/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import assert from 'assert';
import chalk from 'chalk';
import _ from 'lodash';
import fs from 'fs-extra';
import _ from 'lodash';
import ora from 'ora';
import path from 'path';

Expand All @@ -13,16 +13,17 @@ import {
BlackSSLProviderConfig,
CommandConfig,
CustomProviderConfig,
NodeFilterType,
NodeNameFilterType,
NodeTypeEnum,
PossibleNodeConfigType,
ProviderConfig,
RemoteSnippet,
ShadowsocksJsonSubscribeProviderConfig,
ShadowsocksrSubscribeProviderConfig,
ShadowsocksSubscribeProviderConfig,
SimpleNodeConfig,
SupportProviderEnum,
V2rayNSubscribeProviderConfig,
ShadowsocksSubscribeProviderConfig, ShadowsocksrSubscribeProviderConfig,
} from './types';
import {
getBlackSSLConfig,
Expand All @@ -35,7 +36,10 @@ import {
getShadowsocksNodes,
getShadowsocksNodesJSON,
getShadowsocksrNodes,
getSurgeNodes, getV2rayNSubscription,
getShadowsocksrSubscription,
getShadowsocksSubscription,
getSurgeNodes,
getV2rayNSubscription,
hkFilter,
loadRemoteSnippetList,
netflixFilter as defaultNetflixFilter,
Expand All @@ -44,8 +48,6 @@ import {
toUrlSafeBase64,
usFilter,
youtubePremiumFilter as defaultYoutubePremiumFilter,
getShadowsocksSubscription,
getShadowsocksrSubscription,
} from './utils';

const spinner = ora();
Expand Down Expand Up @@ -156,8 +158,13 @@ export async function generate(
isValid = true;
}

if (config.binPath && config.binPath[nodeConfig.type]) {
nodeConfig.binPath = config.binPath[nodeConfig.type];
if (config.binPath) {
if (config.binPath.v2ray) {
config.binPath.vmess = config.binPath.v2ray;
}
if (config.binPath[nodeConfig.type]) {
nodeConfig.binPath = config.binPath[nodeConfig.type];
}
}

if (isValid) {
Expand Down
1 change: 1 addition & 0 deletions lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export interface CommandConfig {
readonly binPath?: {
readonly shadowsocksr?: string;
readonly v2ray?: string;
vmess?: string; // tslint:disable-line
};
}

Expand Down

0 comments on commit fb2e4b9

Please sign in to comment.