From 0d8761e5f907d173c40a2a44f3a1d8d8ce5a2f6e Mon Sep 17 00:00:00 2001 From: Weicao-CatilGrass <1992414357@qq.com> Date: Mon, 9 Jun 2025 12:06:15 +0800 Subject: . --- .../scripts/install_completion_powershell.ps1 | 39 +++++++++++++++++++++ .idea/runConfigurations/Build_All.xml | 4 +-- .idea/runConfigurations/Build_All__Dev_.xml | 4 +-- .idea/runConfigurations/Build_Bevy_Client.xml | 2 +- .../runConfigurations/Build_Bevy_Client__Dev_.xml | 2 +- .idea/runConfigurations/Build_Console.xml | 2 +- .idea/runConfigurations/Build_Console__Dev_.xml | 2 +- .idea/runConfigurations/Build_Core.xml | 2 +- .idea/runConfigurations/Build_Core__Dev_.xml | 2 +- .idea/runConfigurations/Export_Project.xml | 4 +-- .idea/runConfigurations/Export_Project__Dev_.xml | 2 +- .idea/runConfigurations/Run_Bevy_Client.xml | 5 +-- Cargo.lock | 10 ++++++ Config_Export.toml | 4 +-- LICENSE-THIRD-PARTY | 2 ++ console/Cargo.toml | 1 + console/src/bin/padc.rs | 18 ++++++++-- export/dev/LICENSE-THIRD-PARTY | 2 ++ export/dev/bin/padc.exe | Bin 6123008 -> 6471168 bytes 19 files changed, 86 insertions(+), 21 deletions(-) create mode 100644 .cargo/resources/scripts/install_completion_powershell.ps1 diff --git a/.cargo/resources/scripts/install_completion_powershell.ps1 b/.cargo/resources/scripts/install_completion_powershell.ps1 new file mode 100644 index 0000000..8707870 --- /dev/null +++ b/.cargo/resources/scripts/install_completion_powershell.ps1 @@ -0,0 +1,39 @@ +$ErrorActionPreference = "Stop" + +try { + # Check if padc.exe exists in the current directory + if (-not (Test-Path -Path ".\..\padc.exe" -PathType Leaf)) { + throw "Error: padc.exe program not found in the current directory" + } + + # Generate completion script + Write-Host "Generating padc.ps1 file..." + .\..\padc.exe generate-completion powershell | Out-File padc.ps1 -Encoding utf8 -Force + + # Get target profile file path + $targetProfile = $PROFILE.CurrentUserAllHosts + + # Ensure the profile directory exists + $profileDir = Split-Path $targetProfile -Parent + if (-not (Test-Path $profileDir)) { + New-Item -ItemType Directory -Path $profileDir -Force | Out-Null + } + + # Copy the generated script to the profile file + Write-Host "Installing to user profile file..." + Copy-Item padc.ps1 $targetProfile -Force + + # Clean up temporary files (optional) + # Remove-Item padc.ps1 -Force + + Write-Host "`nComplete! Auto-completion has been successfully installed to $targetProfile" -ForegroundColor Green + Write-Host "Effective in new terminal sessions (restart PowerShell to use)" +} +catch { + Write-Host "`nError: $_" -ForegroundColor Red + exit 1 +} + +# Pause the script +Write-Host "`nPress any key to continue..." +$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") \ No newline at end of file diff --git a/.idea/runConfigurations/Build_All.xml b/.idea/runConfigurations/Build_All.xml index 98eb17f..51694ee 100644 --- a/.idea/runConfigurations/Build_All.xml +++ b/.idea/runConfigurations/Build_All.xml @@ -1,11 +1,11 @@ - +