Skip to content

Commit

Permalink
updated export-exchanges.js duplicate header bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Oct 25, 2017
1 parent e91f97d commit 4954b55
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions export-exchanges.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ lines[1] = headerLine.join ('|')

lines = lines.map (line => '|' + line + '|').join ("\n")

let changeInFile = (filename) => {
let changeInFile = (filename, prefix = '') => {
log.bright ('Exporting exchanges to'.cyan, filename.yellow, '...')
let oldContent = fs.readFileSync (filename, 'utf8')
let beginning = "# Supported Exchanges\n\nThe ccxt library currently supports the following "
let beginning = prefix + "The ccxt library currently supports the following "
let ending = " cryptocurrency exchange markets and trading APIs:\n\n"
let regex = new RegExp ("[^\n]+[\n][\n]\\|[^#]+\\|([\n][\n]|[\n]$|$)", 'm')
let totalString = beginning + numExchanges + ending
Expand All @@ -126,8 +126,8 @@ let changeInFile = (filename) => {
}

changeInFile ('README.md')
changeInFile (wikiPath + '/Exchange-Markets.md')
changeInFile (wikiPath + '/Manual.md')
changeInFile (wikiPath + '/Exchange-Markets.md', "# Supported Exchanges\n\n")
changeInFile (wikiPath + '/Manual.md', "# Supported Exchanges\n\n")

// console.log (typeof countries)
// console.log (countries)
Expand Down

0 comments on commit 4954b55

Please sign in to comment.