Skip to content

Commit

Permalink
Modified excelreader.js to use constant for path to inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
underdorff18 committed Jun 16, 2023
1 parent c4b6c9a commit be554e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ExcelReader/excelreader.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const chokidar = require('chokidar');
const System = require('./system');
const { all } = require('express/lib/application');

//const myfilepath = Path.join(__dirname, 'Inventory', 'samplepc1234.xlsx');
const PathToInventoryDirectory = Path.join(__dirname, "Inventory");

//given a full path to a file, this function will produce a system object or an object with an error key
//if formatted incorrectly
Expand Down Expand Up @@ -73,15 +73,15 @@ async function syncDirToDatabase(directory) {
}


var inventoryWatcher = chokidar.watch(Path.join(__dirname, "Inventory"), {
var inventoryWatcher = chokidar.watch(PathToInventoryDirectory, {
ignored: /(^|[\/\\])\../,
persistent: true,
awaitWriteFinish: true,
ignoreInitial: true
});
console.log(`Watching directory for changes...` )

syncDirToDatabase(Path.join(__dirname, "Inventory"));
syncDirToDatabase(PathToInventoryDirectory);

inventoryWatcher
.on('add', function(filepath) {
Expand Down

0 comments on commit be554e0

Please sign in to comment.