diff --git a/docs/index.md b/docs/index.md index 66aa50f..6483e90 100644 --- a/docs/index.md +++ b/docs/index.md @@ -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** diff --git a/package.json b/package.json index 2b44ac1..876c9ef 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "poketrax", "productName": "PokeTrax", - "version": "0.4.0", + "version": "0.4.1", "main": "src/main.js", "homepage": ".", "private": true, diff --git a/src/database.js b/src/database.js index a902c22..6b92ff9 100644 --- a/src/database.js +++ b/src/database.js @@ -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'); @@ -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') { @@ -286,6 +298,7 @@ const init = async () => { } } +module.exports.appPath = appPath module.exports.getCollectionDownload = getCollectionDownload module.exports.dbStatus = dbStatus module.exports.init = init diff --git a/src/main.js b/src/main.js index 0f08246..9f8e59a 100644 --- a/src/main.js +++ b/src/main.js @@ -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, });