Skip to content

Commit

Permalink
Refactor generate launch script
Browse files Browse the repository at this point in the history
  • Loading branch information
trippyone committed Feb 24, 2025
1 parent b321916 commit 5f7e473
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/services/headless/FikaHeadlessProfileService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,13 @@ export class FikaHeadlessProfileService {
await this.fileSystem.ensureDir(scriptsFolderPath);
}

const scriptName = `Start_${profileId}.bat`;
const scriptPath = path.join(scriptsFolderPath, scriptName);

const templatePath = path.join(scriptsFolderPath, "_TEMPLATE.bat");
const templateContent = await this.fileSystem.read(templatePath);

const scriptContent = templateContent.replace("${profileId}", profileId).replace("${backendUrl}", backendUrl);

const scriptName = `Start_${profileId}.bat`;
const scriptPath = path.join(scriptsFolderPath, scriptName);

await this.fileSystem.write(scriptPath, scriptContent);

this.logger.success(`Generated launch script: /fika-server/assets/scripts/${scriptName}`);
Expand Down

0 comments on commit 5f7e473

Please sign in to comment.