Commit f40f4b46 authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent 718ea4c0
......@@ -16,6 +16,24 @@ async function init() {
let com = await fs.readFileSync('com.json', 'utf8');
com = JSON.parse(com)
for (let i=0;i<com.length;i++)
{
let t = com[i].platform
t = t.split('_')
let lp = t[4]
com[i].lp=lp
}
com=_.uniqBy(com, 'lp');
let newCom=[]
for (let i=0;i<100;i++)
{
newCom.push(com[i])
}
com=newCom
createComResfileADV(JSON.stringify(com, null, 2))
for (let i = 0; i < com.length; i++) {
let t = com[i].platform
t = t.split('_')
......@@ -57,6 +75,16 @@ function createRunResfileADV(data) {
});
}
function createComResfileADV(data) {
// console.log(data)
return new Promise(function (resolve, reject) {
fs.writeFile(pairs+'newCom.json', data, 'utf8', function (err) {
if (err) reject(err);
else resolve(data);
});
});
}
function found(pair, lp) {
for (let i = 0; i < res.length; i++) {
if (!res[i].includes(lp + '_'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment