Skip to content

Commit 1edea87

Browse files
try different way to get home dir
1 parent b6b979a commit 1edea87

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

.github/workflows/unity-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ jobs:
7373
if: ${{ matrix.unity-version != 'none' }}
7474
shell: bash
7575
run: |
76+
unity-cli license-context
7677
unity-cli activate-license --license personal --email "${{ secrets.UNITY_USERNAME }}" --password "${{ secrets.UNITY_PASSWORD }}"
7778
- name: Print log paths
7879
if: ${{ matrix.unity-version != 'none' }}

src/unity-editor.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import * as os from 'os';
21
import * as fs from 'fs';
32
import * as path from 'path';
43
import { Logger } from './logging';
@@ -454,9 +453,9 @@ export class UnityEditor {
454453
static GetEditorLogsDirectory() {
455454
switch (process.platform) {
456455
case 'darwin':
457-
return path.join(os.homedir(), 'Library', 'Logs', 'Unity');
456+
return path.join(process.env.HOME || '', 'Library', 'Logs', 'Unity');
458457
case 'linux':
459-
return path.join(os.homedir(), '.config', 'unity3d', 'Editor');
458+
return path.join(process.env.HOME || '', '.config', 'unity3d', 'Editor');
460459
case 'win32':
461460
return path.join(process.env.LOCALAPPDATA || '', 'Unity', 'Editor');
462461
default:

src/unity-hub.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,10 +1271,10 @@ done
12711271
return path.join(process.env.APPDATA || '', 'UnityHub', 'logs', 'info-log.json');
12721272
case 'darwin':
12731273
// ~/Library/Application Support/UnityHub/logs/info-log.json
1274-
return path.join(os.homedir(), 'Library', 'Application Support', 'UnityHub', 'logs', 'info-log.json');
1274+
return path.join(process.env.HOME || '', 'Library', 'Application Support', 'UnityHub', 'logs', 'info-log.json');
12751275
case 'linux':
12761276
// ~/.config/UnityHub/logs/info-log.json
1277-
return path.join(os.homedir(), '.config', 'UnityHub', 'logs', 'info-log.json');
1277+
return path.join(process.env.HOME || '', '.config', 'UnityHub', 'logs', 'info-log.json');
12781278
default:
12791279
throw new Error(`Unsupported platform: ${process.platform}`);
12801280
}

0 commit comments

Comments
 (0)