diff --git a/src/services/command-service.ts b/src/services/command-service.ts index b64b49c..c1f69bf 100644 --- a/src/services/command-service.ts +++ b/src/services/command-service.ts @@ -308,9 +308,12 @@ export default class CommandService implements Disposable { window.onDidEndTerminalShellExecution(e => { if (e.execution === this._execution) { this._logger.info( - `execute command successfully!`, + `Command executed successfully!`, e.execution.commandLine, ); + window.showInformationMessage( + `The \`${commandLine}\` was executed successfully!`, + ); } }), ); diff --git a/src/utils/modules.ts b/src/utils/modules.ts index 81a96ab..1b6fec5 100644 --- a/src/utils/modules.ts +++ b/src/utils/modules.ts @@ -113,20 +113,30 @@ export async function getModulesQuickPick2(modules: IModule[]) { return modules.find(module => module.name === selectedModule.label); } +/** + * + * @param project 用户选择的子项目 + * @param p 选择的文件上下文, 当直接在资源管理器视图中右键操作为undefined + * @returns + */ export async function checkoutFolderIsModule(project?: INestProject, p?: Uri) { if (!p) { - return; + return []; } if (fs.statSync(p.fsPath).isFile()) { - return; + return []; } let _modules: IModule[] = []; // 从当前的项目中的sourceRoot下选择对应的module出来 + const cwd = !project + ? p.fsPath + : Uri.joinPath(project.workspace.uri, project.root || '').fsPath; + const entries = fg.globSync([`**/*.module.(t|j)s`], { - cwd: !project ? p.fsPath : Uri.joinPath(p, project.name).fsPath, + cwd: cwd, deep: 4, dot: false, absolute: true, @@ -146,6 +156,5 @@ export async function checkoutFolderIsModule(project?: INestProject, p?: Uri) { }); } } - console.log(_modules); return _modules; }