Skip to content

Commit

Permalink
fixing import filename passing
Browse files Browse the repository at this point in the history
  • Loading branch information
tnrich committed Sep 18, 2019
1 parent 54251c0 commit 223b957
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Binary file modified .DS_Store
Binary file not shown.
13 changes: 7 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ function getSeqJsonFromPath(_filePath) {
let filePath = _filePath || process.argv[1];
if (filePath === ".") return;
const data = fs.readFileSync(path.resolve(filePath), "utf-8");

//open, read, handle file
if (!data) return;
return bioParsers.anyToJson(data).then(res => {
const fileName = filePath.replace(/^.*[\\\/]/, "");
return bioParsers.anyToJson(data, { fileName }).then(res => {
return res[0].parsedSequence;
});
}
Expand All @@ -39,9 +39,9 @@ async function createWindow(windowVars) {
if (!windowVars && process.platform === "win32") {
//windows only
try {
startupWindowVars.initialSeqJson = await getSeqJsonFromPath(
startupWindowVars
);
const initialSeqJson = await getSeqJsonFromPath();

startupWindowVars.initialSeqJson = initialSeqJson;
} catch (e) {
console.error(`e123421231:`, e);
}
Expand Down Expand Up @@ -76,7 +76,8 @@ app.on("will-finish-launching", () => {
//mac only
event.preventDefault();
try {
startupWindowVars.initialSeqJson = await getSeqJsonFromPath(path);
const initialSeqJson = await getSeqJsonFromPath(path);
startupWindowVars.initialSeqJson = initialSeqJson;
} catch (e) {
console.error(`e73562891230:`, e);
}
Expand Down

0 comments on commit 223b957

Please sign in to comment.