forked from guguji5/test-github-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
40 lines (32 loc) · 1.32 KB
/
Copy pathindex.js
File metadata and controls
40 lines (32 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
var shell = require('shelljs');
const fs = require('fs')
// const shStockTxt = fs.readFileSync(`./5.4.txt`, 'utf8');
// const shStockList = JSON.parse(shStockTxt).Results.map(item=> item.split(',')[1])
const shStockTxt = fs.readFileSync(`./sh.txt`, 'utf8');
const shStockList = JSON.parse(shStockTxt).Results.map(item=> item.split(',')[1])
const szStockTxt = fs.readFileSync(`./sz.txt`, 'utf8');
const szStockList = JSON.parse(szStockTxt).Results.map(item=> item.split(',')[1])
const cybStockTxt = fs.readFileSync(`./cyb.txt`, 'utf8');
const cybStockList = JSON.parse(cybStockTxt).Results.map(item=> item.split(',')[1])
// shell.config.silent = true;
// shell.config.verbose = false;
const stockList = Array.from(new Set([...shStockList, ...szStockList, ...cybStockList]))
// const stockList = Array.from(new Set([...shStockList])).slice(1000, 2000)
function genPrefix(str){
if(['600','601','603', '605', '688'].includes(str.slice(0,3))){
return 'SH'
}
if(['00','30'].includes(str.slice(0,2))){
return 'SZ'
}
console.log(str,'not found prefix')
return
}
// for(var i=0;i< stockList.length;i++){
// var prefix = genPrefix(stockList[i].trim())
// console.log(i)
// prefix && shell.exec(`node matchHolders.js --code=${prefix}${stockList[i].trim()}`)
// }
module.exports = {
genPrefix
};