Commit 08497a26 authored by Ahmad Nemati's avatar Ahmad Nemati

git pull

parent 20635978
...@@ -130,6 +130,7 @@ async function run(root,name, directory, timestamp) { ...@@ -130,6 +130,7 @@ async function run(root,name, directory, timestamp) {
last=[] last=[]
let newLast=[] let newLast=[]
let jj='[' let jj='['
await append(jj)
for (let i=0;i<las.length;i++) for (let i=0;i<las.length;i++)
{ {
let sidee=las[i].sideString let sidee=las[i].sideString
...@@ -137,9 +138,11 @@ last=[] ...@@ -137,9 +138,11 @@ last=[]
let inline='{"c":"'+las[i].closeDate+'","p":"'+las[i].profitLossString+'","s":"'+sidee+'"}' let inline='{"c":"'+las[i].closeDate+'","p":"'+las[i].profitLossString+'","s":"'+sidee+'"}'
if (i !==(las.length-1)) if (i !==(las.length-1))
inline=inline+',' inline=inline+','
jj=jj+inline await append(inline)
// jj=jj+inline
} }
jj=jj+']' await append(']')
// jj=jj+']'
//console.log(las.length) //console.log(las.length)
...@@ -148,6 +151,17 @@ last=[] ...@@ -148,6 +151,17 @@ last=[]
last = [] last = []
} }
async function append(data)
{
return new Promise(function (resolve, reject) {
fs.appendFile('newFile.json', data, function (err) {
if (err) throw err;
resolve(true)
});
});
}
async function readFile(root,name, directory) { async function readFile(root,name, directory) {
let sortByProfit = [] let sortByProfit = []
......
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