Skip to content

Commit

Permalink
Add old modHub data (FS19, 17 & 15 to app) - #65
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsage committed Feb 10, 2023
1 parent dc08049 commit f153ec6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/oldModHub.json

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion modAssist_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ if ( process.platform === 'win32' && app.isPackaged && gotTheLock && !isPortable
}

const fxml = require('fast-xml-parser')
const oldModHub = require('./lib/oldModHub.json')
const userHome = app.getPath('home')
const pathRender = path.join(app.getAppPath(), 'renderer')
const pathPreload = path.join(pathRender, 'preload')
Expand Down Expand Up @@ -2192,13 +2193,17 @@ function loadSaveFile(filename) {
try {
const rawData = fs.readFileSync(path.join(app.getPath('userData'), filename))
const jsonData = JSON.parse(rawData)
let merger = null

switch (filename) {
case 'modHubData.json' :
merger = { ...oldModHub.mods, ...jsonData.mods}
jsonData.mods = merger
modCollect.modHubList = jsonData
break
case 'modHubVersion.json' :
modCollect.modHubVersion = jsonData
merger = { ...oldModHub.versions, ...jsonData}
modCollect.modHubVersion = merger
break
default :
break
Expand Down

0 comments on commit f153ec6

Please sign in to comment.