Skip to content

Commit

Permalink
删除调试打印
Browse files Browse the repository at this point in the history
  • Loading branch information
Cnotech committed Jun 4, 2022
1 parent 0023c34 commit c035d65
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/main/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {dialog, ipcMain} from "electron";
import {GameInfo, Reply, Request} from "../class";
import manager from "./manager";
import {Err, Ok, Result} from "ts-results";
import {isPackaged, logToRenderer, restart, toggleDevtool, version} from "./index";
import {isPackaged, restart, toggleDevtool, version} from "./index";
import {getConfig, setConfig} from "./config";
import path from "path";
import fs from "fs";
Expand Down Expand Up @@ -179,7 +179,6 @@ const registry: { [name: string]: (...args: any) => any } = {
confirmPort: async (direction: 'Import' | 'Export', games: GameInfo[], includeProgress: boolean, advisedFileName?: string): Promise<Result<string, string>> => {
if (direction == 'Import') {
//处理导入
logToRenderer('proc import')
let source, target, progressRestoreError: { info: GameInfo, errMsg: string }[] = []
for (let game of games) {
if (game.local == null) return new Err(`Error:Fatal error : ${game.title} don't include local key`)
Expand All @@ -197,18 +196,15 @@ const registry: { [name: string]: (...args: any) => any } = {
return new Err(`Error:Import failed : ${game.type}/${game.local.folder}`)
}
//导入游戏进度
logToRenderer('jud')
if (includeProgress && fs.existsSync(path.join(target, "_FC_PROGRESS_BACKUP_/backup.json"))) {
let r = await restore(game, true)
logToRenderer(r.err)
if (r.err) {
progressRestoreError.push({
info: game,
errMsg: r.val
})
} else {
//成功恢复后删除本地的备份
logToRenderer(path.join(target, "_FC_PROGRESS_BACKUP_"))
shelljs.rm("-rf", path.join(target, "_FC_PROGRESS_BACKUP_"))
}
} else if (fs.existsSync(path.join(target, "_FC_PROGRESS_BACKUP_"))) {
Expand Down

0 comments on commit c035d65

Please sign in to comment.