diff --git a/src/cli/services/path.service.spec.ts b/src/cli/services/path.service.spec.ts index 159590e20..a1d6f0463 100644 --- a/src/cli/services/path.service.spec.ts +++ b/src/cli/services/path.service.spec.ts @@ -17,6 +17,12 @@ describe('path.service', () => { delete env.NODE_VERSION; }); + test('cachePath', () => { + expect(child.get(PathService).cachePath).toBe( + rootPath('opt/containerbase/cache'), + ); + }); + test('envFile', () => { expect(child.get(PathService).envFile).toBe(rootPath('usr/local/etc/env')); }); @@ -25,6 +31,12 @@ describe('path.service', () => { expect(child.get(PathService).tmpDir).toBe(rootPath('tmp')); }); + test('homePath', () => { + expect(child.get(PathService).homePath).toBe( + rootPath('opt/containerbase/home'), + ); + }); + test('toolsPath', () => { expect(child.get(PathService).toolsPath).toBe( rootPath('opt/containerbase/tools'), diff --git a/src/cli/services/path.service.ts b/src/cli/services/path.service.ts index b46acb67e..8749fd1ce 100644 --- a/src/cli/services/path.service.ts +++ b/src/cli/services/path.service.ts @@ -36,6 +36,14 @@ export class PathService { return join(this.installDir, 'versions'); } + get homePath(): string { + return join(this.installDir, 'home'); + } + + get cachePath(): string { + return join(this.installDir, 'cache'); + } + constructor(@inject(EnvService) private envSvc: EnvService) {} async createToolPath(tool: string): Promise<string> {