log file path

This commit is contained in:
Frostebite 2023-05-13 20:52:19 +01:00
parent 1a5b953c86
commit 4a4b472a1b
3 changed files with 1 additions and 5 deletions

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

View File

@ -1,18 +1,14 @@
import path from 'node:path'; import path from 'node:path';
import { CloudRunnerFolders } from '../options/cloud-runner-folders';
import CloudRunnerLogger from '../services/core/cloud-runner-logger'; import CloudRunnerLogger from '../services/core/cloud-runner-logger';
import fs from 'node:fs'; import fs from 'node:fs';
export class RemoteClientLogger { export class RemoteClientLogger {
private static get LogFilePath() { private static get LogFilePath() {
return path.join(CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute, `job-log.txt`); return path.join(`/home`, `job-log.txt`);
} }
public static log(message: string) { public static log(message: string) {
const finalMessage = `[Client] ${message}`; const finalMessage = `[Client] ${message}`;
if (!fs.existsSync(CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute)) {
fs.mkdirSync(CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute);
}
if (!fs.existsSync(this.LogFilePath)) { if (!fs.existsSync(this.LogFilePath)) {
fs.writeFileSync(this.LogFilePath, ``); fs.writeFileSync(this.LogFilePath, ``);
} }