Skip to content

Commit

Permalink
removed config usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudiohbsantos committed Jun 3, 2019
1 parent c433a74 commit 5d3c4c2
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 288 deletions.
4 changes: 2 additions & 2 deletions bin/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ let renamed = 0



add.main = function(input,config) {
add.main = function(input) {
log.info('DBAssistant: Adding files to Databases')
add.history = require(path.resolve(__dirname,'..','lib','history.js'))(input.user,config.databases,config.library)
add.history = require(path.resolve(__dirname,'..','lib','history.js'))(input.user,input.library)

lib = new add.library(input.library)
input.list.forEach(el => {
Expand Down
10 changes: 1 addition & 9 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ program

input = readJsonBatch(input)

require(path.resolve(__dirname,'add.js')).main(input,config)
require(path.resolve(__dirname,'add.js')).main(input)
})

program
Expand All @@ -46,14 +46,6 @@ program
require(path.resolve(__dirname,'export.js')).main(input)
})

program
.command('test')
.description('Test connections to server')
.action(() => {
if (program.quiet) {log.quiet}
require(path.resolve(__dirname,'test.js'))()
})

program.parse(process.argv)

//
Expand Down
9 changes: 4 additions & 5 deletions lib/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ function escapeRegExp(text) {
}

class historyLogger {
constructor(user,DBFolder,LibFolder) {
constructor(user,LibFolder) {
this.user = user
this.dbDir = new RegExp('^'+escapeRegExp(DBFolder),'i')
this.libDir = new RegExp('^'+escapeRegExp(LibFolder),'i')

let logdir = path.join(DBFolder,"history")
Expand All @@ -42,7 +41,7 @@ ${this.sep}\n` + this.history
log(filePath,dbs) {
filePath = filePath.replace(this.libDir,'')
this.history += filePath + ' -> '
dbs.forEach(db => {this.history += db.replace(this.dbDir,'') + ','})
dbs.forEach(db => {this.history += db + ','})
this.history += '\n'
}

Expand All @@ -57,6 +56,6 @@ ${this.sep}\n` + this.history
}
}

function createHistoryLogger(user,DBFolder,LibFolder) {
return new historyLogger(user,DBFolder,LibFolder)
function createHistoryLogger(user,LibFolder) {
return new historyLogger(user,LibFolder)
}
Loading

0 comments on commit 5d3c4c2

Please sign in to comment.