From f71a5e53a34dfd98946bfc4f1c34d53296bd0d4b Mon Sep 17 00:00:00 2001 From: EscapeB Date: Thu, 22 Feb 2024 18:09:12 +0800 Subject: [PATCH] fix: fix sparo profile load path in SparoProfileService --- apps/sparo-lib/src/services/SparoProfileService.ts | 8 +++++++- ...-fix_sparse_service_load_path_2024-02-22-10-08.json | 10 ++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 common/changes/sparo/fix-fix_sparse_service_load_path_2024-02-22-10-08.json diff --git a/apps/sparo-lib/src/services/SparoProfileService.ts b/apps/sparo-lib/src/services/SparoProfileService.ts index da2b33d..08d920a 100644 --- a/apps/sparo-lib/src/services/SparoProfileService.ts +++ b/apps/sparo-lib/src/services/SparoProfileService.ts @@ -1,4 +1,5 @@ import { FileSystem, Async } from '@rushstack/node-core-library'; +import path from 'path'; import { inject } from 'inversify'; import { Service } from '../decorator'; import { SparoProfile } from '../logic/SparoProfile'; @@ -22,7 +23,12 @@ export class SparoProfileService { public async loadProfilesAsync(): Promise { if (!this._loadPromise) { this._loadPromise = (async () => { - const sparoProfileFolder: string = defaultSparoProfileFolder; + const repoRoot: string = this._gitService.getRepoInfo().root; + const sparoProfileFolder: string = path.resolve(repoRoot, defaultSparoProfileFolder); + this._terminalService.terminal.writeDebugLine( + 'loading sparse profiles from folder:', + sparoProfileFolder + ); const sparoProfilePaths: string[] = await FileSystem.readFolderItemNamesAsync(sparoProfileFolder, { absolutePaths: true }); diff --git a/common/changes/sparo/fix-fix_sparse_service_load_path_2024-02-22-10-08.json b/common/changes/sparo/fix-fix_sparse_service_load_path_2024-02-22-10-08.json new file mode 100644 index 0000000..b584a7f --- /dev/null +++ b/common/changes/sparo/fix-fix_sparse_service_load_path_2024-02-22-10-08.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "sparo", + "comment": "fix load path in sparo profile service", + "type": "none" + } + ], + "packageName": "sparo" +} \ No newline at end of file