Skip to content

Commit

Permalink
Merge pull request #21 from poketrax/v0.4.1
Browse files Browse the repository at this point in the history
V0.4.1
  • Loading branch information
jgunzelman88 authored May 27, 2022
2 parents 6ddd3e0 + e3edf85 commit fb07369
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PokeTrax is an open source and free to use Pokémon TCG collection management to
* Monitor price changes
* Search for Cards
## Downloads
[![Windows](assets/windows.png)](https://github.com/poketrax/PokeTrax/releases/download/v0.4.0-beta/PokeTrax.Setup.0.4.0.exe)[![MacOS](assets/macos.png)](https://github.com/poketrax/PokeTrax/releases/download/v0.4.0-beta/PokeTrax-0.4.0.dmg)
[![Windows](assets/windows.png)](https://github.com/poketrax/PokeTrax/releases/download/v0.4.1-beta/PokeTrax.Setup.0.4.1.exe)[![MacOS](assets/macos.png)](https://github.com/poketrax/PokeTrax/releases/download/v0.4.1-beta/PokeTrax-0.4.1.dmg)
## Install Instructions:

* **Windows**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "poketrax",
"productName": "PokeTrax",
"version": "0.4.0",
"version": "0.4.1",
"main": "src/main.js",
"homepage": ".",
"private": true,
Expand Down
13 changes: 13 additions & 0 deletions src/database.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path')
const { app } = require('electron');
const os = require("os");
const fs = require('fs');
const compver = require('compare-version');
Expand All @@ -14,6 +15,17 @@ const Database = require('better-sqlite3');

/* Print the working directory for the application to get date files */
const pwd = () => {
if (process.env.NODE_ENV === 'development') {
return "./"
} else if (process.env.NODE_ENV === 'ci-test') {
return path.join(process.env.PWD, "/build")
} else if (process.env.NODE_ENV === 'test') {
return "./test/data"
}
return app.getPath("appData")
}

const appPath = () => {
if (process.env.NODE_ENV === 'development') {
return "./"
} else if (process.env.NODE_ENV === 'ci-test') {
Expand Down Expand Up @@ -286,6 +298,7 @@ const init = async () => {
}
}

module.exports.appPath = appPath
module.exports.getCollectionDownload = getCollectionDownload
module.exports.dbStatus = dbStatus
module.exports.init = init
Expand Down
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let mainWindow;

function createWindow () {
const startUrl = process.env.ELECTRON_START_URL ||url.format({
pathname: path.join(DB.pwd(), './index.html'),
pathname: path.join(DB.appPath(), './index.html'),
protocol: 'file:',
slashes: true,
});
Expand Down

0 comments on commit fb07369

Please sign in to comment.