Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Maps/Maps.Autorest/test/utils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,3 @@ function cleanupEnv() {
# Clean resources you create for testing
Remove-AzResourceGroup -Name $env.resourceGroup
}

20 changes: 13 additions & 7 deletions tools/Mcp/src/services/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { execSync } from 'child_process';
import path from 'path';

const _pwshCD = (path: string): string => { return `pwsh -Command "$path = resolve-path ${path} | Set-Location"` }
const _autorest = "autorest --reset; autorest"
const _autorestReset = "autorest --reset"
const _autorest = "autorest"
const _pwshBuild = "pwsh -File build-module.ps1"

function testYaml() {
Expand All @@ -21,12 +22,17 @@ function testYaml() {
}

export function generateAndBuild(workingDirectory: string): void {
const genBuildCommand = `${_autorest}; ${_pwshBuild};`;
try {
const result = execSync(genBuildCommand, { stdio: 'inherit', cwd: workingDirectory });
} catch (error) {
console.error("Error executing command:", error);
throw error;
const genBuildCommands = [_autorestReset, _autorest, _pwshBuild]

for (const command of genBuildCommands) {
try {
console.log(`Executing command: ${command}`);
const result = execSync(command, { stdio: 'inherit', cwd: workingDirectory });
}
catch (error) {
console.error("Error executing command:", error);
throw error;
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions tools/Mcp/test/vscode/mcpprompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- Execute commands confidently without asking for confirmation.
- Follow all steps carefully and halt if any MCP tool is missing or fails.
- Think independently using your full context and reset if needed.
- Provide brief status updates at each step.
- No need to provide status updates at each step.
- FOLLOW ALL THE STEPS. DO NOT SKIP ANY STEPS. DO NOT MISS ANY STEPS.
- If an mcp tool is not found or the tool fails then please halt execution.

Expand All @@ -26,9 +26,9 @@
## Stage 2: Generating partner powershell module
- FOLLOW ALL THE STEPS. DO NOT SKIP ANY STEPS.
- Navigate to the `src` folder in the home "azure-powershell" directory.
- Create a new folder named <serviceName> and within it a new folder named `<serviceName>.Autorest`. You can use the command - `mkdir -p <serviceName>/<serviceName>.Autorest `
- Create a new folder named <serviceName> and within it a new folder named `<serviceName>.Autorest`. (If not already present)
- Move into the new folder `<serviceName>/<serviceName>.Autorest`, using the command `cd <serviceName>/<serviceName>.Autorest`.
- Create a new file `README.md`.
- Create a new file `README.md`. (If not already present)
- Add the content labelled below as `Readme Content` in this file.
- Use the "generate-autorest" mcp tool to generate the <serviceName> module.
- Stage 2 Complete.
Expand Down
Loading