Skip to content

Commit

Permalink
Fix release.
Browse files Browse the repository at this point in the history
  • Loading branch information
luckytyphlosion committed Jun 5, 2023
1 parent 15fdc80 commit ef6eda7
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 14 deletions.
5 changes: 2 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"productName": "Auto-TT-Recorder GUI",
"description": "GUI wrapper for Auto-TT-Recorder",
"author": "luckytyphlosion",
"version": "0.2.6",
"version": "0.2.7",
"autoTTRecorderVersion": "1.3.4",
"dolphinVersion": "1.0.0",
"private": true,
Expand Down Expand Up @@ -40,7 +40,6 @@
"eslint-config-react-app": "^7.0.1",
"eslint-webpack-plugin": "^3.1.1",
"file-loader": "^6.2.0",
"fs-extra": "^10.1.0",
"html-webpack-plugin": "^5.5.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^27.4.3",
Expand Down Expand Up @@ -187,6 +186,7 @@
"appId": "com.auto-tt-recorder-gui.app",
"artifactName": "Auto-TT-Recorder-GUI-${version}-${os}-${arch}.${ext}",
"compression": "normal",
"asar": false,
"win": {
"target": "nsis"
},
Expand All @@ -208,13 +208,11 @@
"files": [
"package.json",
"dist/**",
"auto-tt-recorder_v1.3.4_for_gui/**",
"data/**",
"!build_scripts/**/*",
"!node_modules/**/*",
"!webpack/**/*"
],
"extraResources": [
"auto-tt-recorder_v1.3.4_for_gui/**",
"data/**"
]
},
"license": "GPL-2.0-or-later"
Expand Down
6 changes: 4 additions & 2 deletions src/main/auto-tt-rec-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function writeFixedDynamicAutoTTRecArgs(autoTTRecTemplate: AutoTTRecConfig) {
autoTTRecTemplate["storage-folder"] = globalConfig.storagePath.replaceAll("\\", "/");
autoTTRecTemplate["chadsoft-cache-folder"] = globalConfig.chadsoftCachePath.replaceAll("\\", "/");
autoTTRecTemplate["temp-folder"] = globalConfig.tempPath.replaceAll("\\", "/");
console.log("autoTTRecTemplate['dolphin-folder']:", autoTTRecTemplate["dolphin-folder"]);
}

export async function spawnAutoTTRec(event: IpcMainInvokeEvent, templateFilename: string, autoTTRecArgs: object) {
Expand All @@ -64,14 +65,15 @@ export async function spawnAutoTTRec(event: IpcMainInvokeEvent, templateFilename
writeFixedDynamicAutoTTRecArgs(autoTTRecTemplate);

const generatedConfigContents = YAML.stringify(autoTTRecTemplate);
let resultConfigFilepath = path.resolve(globalConfig.tempPath, "config.yml");

await fsPromises.writeFile(path.resolve(__dirname, "../..", versions.AUTO_TT_RECORDER_FOLDER_NAME, "config.yml"), generatedConfigContents, "utf8");
await fsPromises.writeFile(resultConfigFilepath, generatedConfigContents, "utf8");
console.log("spawn-auto-tt-rec process.cwd():", process.cwd());

// Run auto-tt-recorder here
let autoTTRecProcessNonNull = child_process.spawn(
path.resolve(__dirname, "../..", versions.AUTO_TT_RECORDER_FOLDER_NAME, "bin/record_ghost/record_ghost.exe"),
["-cfg", "config.yml"],
["-cfg", resultConfigFilepath],
{
cwd: path.resolve(__dirname, "../..", versions.AUTO_TT_RECORDER_FOLDER_NAME),
detached: false
Expand Down
18 changes: 16 additions & 2 deletions src/main/electron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import * as gui2 from "./gui2";
import * as confighandler from "./confighandler";

import fs from "fs";
import fse from "fs-extra";

import path from "path";

Expand All @@ -56,6 +55,20 @@ wiimm folder stays where it is
*/

async function copyDirectoryRecursively(fromDir: string, toDir: string) {
await fsPromises.mkdir(toDir, {recursive: true});
let dirContents: string[] = await fsPromises.readdir(fromDir);
await Promise.all(dirContents.map(async (file: string) => {
let fromFileFullPath: string = path.resolve(fromDir, file);
let toFileFullPath: string = path.resolve(toDir, file);
if ((await fsPromises.lstat(fromFileFullPath)).isFile()) {
await fsPromises.copyFile(fromFileFullPath, toFileFullPath);
} else {
await copyDirectoryRecursively(fromFileFullPath, toFileFullPath);
}
}));
}

async function updateAutoTTRecDirectories() {
// copy over dolphin directory elsewhere
// electron-builder auto-update will remove all install files
Expand All @@ -80,9 +93,10 @@ async function updateAutoTTRecDirectories() {
let savedDolphinPath = path.resolve(__dirname, "../..", versions.AUTO_TT_RECORDER_FOLDER_NAME, "dolphin");
console.log("savedDolphinPath:", savedDolphinPath);

await fse.copy(savedDolphinPath, globalConfig.dolphinPath);
await copyDirectoryRecursively(savedDolphinPath, globalConfig.dolphinPath);
}

await fsPromises.mkdir(globalConfig.tempPath, {recursive: true});
globalConfig.updateVersions();
}

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class App extends React.Component<AppProps, AppState> {
return (
<div>
<div className="auto-tt-rec-notes">
<h1 className="title-header">Auto-TT-Recorder GUI (v0.2.6)</h1>
<h1 className="title-header">Auto-TT-Recorder GUI (v0.2.7)</h1>
<ul className="auto-tt-rec-notes-first-half">
<li>All regions are supported, including NTSC-K.</li>
<li>No complex features, just the bare minimum to produce a recording.</li>
Expand Down

0 comments on commit ef6eda7

Please sign in to comment.