@@ -20,44 +20,99 @@ Analyzing code with
2020"@
2121
2222if ($CheckWasm ) {
23- Invoke-LoggedCommand " rustup target add wasm32-unknown-unknown"
23+ # Temporary fix to exit immediately on failure. LogError should Write-Error
24+ # instead
25+ $command = " rustup target add wasm32-unknown-unknown"
26+ Invoke-LoggedCommand $command
27+ if ($LastExitCode ) {
28+ Write-Error " Failed to execute $command "
29+ }
2430}
2531
2632if ($Deny ) {
27- Invoke-LoggedCommand " cargo install cargo-deny --locked"
33+ # Temporary fix to exit immediately on failure. LogError should Write-Error
34+ # instead
35+ $command = " cargo install cargo-deny --locked"
36+ Invoke-LoggedCommand $command
37+ if ($LastExitCode ) {
38+ Write-Error " Failed to execute $command "
39+ }
2840}
2941
30- Invoke-LoggedCommand " cargo check --package azure_core --all-features --all-targets --keep-going"
42+ # Temporary fix to exit immediately on failure. LogError should Write-Error
43+ # instead
44+ $command = " cargo check --package azure_core --all-features --all-targets --keep-going"
45+ Invoke-LoggedCommand $command
46+ if ($LastExitCode ) {
47+ Write-Error " Failed to execute $command "
48+ }
3149
32- Invoke-LoggedCommand " cargo fmt --all -- --check"
50+ # Temporary fix to exit immediately on failure. LogError should Write-Error
51+ # instead
52+ $command = " cargo fmt --all -- --check"
53+ Invoke-LoggedCommand $command
54+ if ($LastExitCode ) {
55+ Write-Error " Failed to execute $command "
56+ }
3357
34- Invoke-LoggedCommand " cargo clippy --workspace --all-features --all-targets --keep-going --no-deps"
58+ # Temporary fix to exit immediately on failure. LogError should Write-Error
59+ # instead
60+ $command = " cargo clippy --workspace --all-features --all-targets --keep-going --no-deps"
61+ Invoke-LoggedCommand $command
62+ if ($LastExitCode ) {
63+ Write-Error " Failed to execute $command "
64+ }
3565
3666if ($CheckWasm ) {
3767 # Save the original RUSTFLAGS to restore later
3868 $OriginalRustFlags = $env: RUSTFLAGS
3969 # This is needed to ensure that the `getrandom` crate uses the `wasm_js` backend
4070 $env: RUSTFLAGS = ${env: RUSTFLAGS} + ' --cfg getrandom_backend="wasm_js"'
4171
42- Invoke-LoggedCommand " cargo clippy --target=wasm32-unknown-unknown --workspace --keep-going --no-deps"
72+ # Temporary fix to exit immediately on failure. LogError should Write-Error
73+ # instead
74+ $command = " cargo clippy --target=wasm32-unknown-unknown --workspace --keep-going --no-deps"
75+ Invoke-LoggedCommand $command
76+ if ($LastExitCode ) {
77+ Write-Error " Failed to execute $command "
78+ }
4379
4480 # Restore the original RUSTFLAGS, since the getrandom config option can only be set for wasm32-unknown-unknown builds.
4581 $env: RUSTFLAGS = $OriginalRustFlags
4682}
4783
4884if ($Deny ) {
49- Invoke-LoggedCommand " cargo deny --all-features check"
85+ # Temporary fix to exit immediately on failure. LogError should Write-Error
86+ # instead
87+ $command = " cargo deny --all-features check"
88+ Invoke-LoggedCommand $command
89+ if ($LastExitCode ) {
90+ Write-Error " Failed to execute $command "
91+ }
5092}
5193
52- Invoke-LoggedCommand " cargo doc --workspace --no-deps --all-features"
94+ # Temporary fix to exit immediately on failure. LogError should Write-Error
95+ # instead
96+ $command = " cargo doc --workspace --no-deps --all-features"
97+ Invoke-LoggedCommand $command
98+ if ($LastExitCode ) {
99+ Write-Error " Failed to execute $command "
100+ }
53101
54102# Verify package dependencies
55103$verifyDependenciesScript = Join-Path $RepoRoot ' eng' ' scripts' ' verify-dependencies.rs' - Resolve
56104
57105if (! $SkipPackageAnalysis ) {
58106 if (! (Test-Path $PackageInfoDirectory )) {
59107 Write-Host " Analyzing workspace`n "
60- return Invoke-LoggedCommand " &$verifyDependenciesScript $RepoRoot /Cargo.toml"
108+ # Temporary fix to exit immediately on failure. LogError should Write-Error
109+ # instead
110+ $command = " &$verifyDependenciesScript $RepoRoot /Cargo.toml"
111+ $result = Invoke-LoggedCommand $command
112+ if ($LastExitCode ) {
113+ Write-Error " Failed to execute $command "
114+ }
115+ return $result
61116 }
62117
63118 $packagesToTest = Get-ChildItem $PackageInfoDirectory - Filter " *.json" - Recurse
@@ -66,6 +121,12 @@ if (!$SkipPackageAnalysis) {
66121
67122 foreach ($package in $packagesToTest ) {
68123 Write-Host " Analyzing package '$ ( $package.Name ) ' in directory '$ ( $package.DirectoryPath ) '`n "
69- Invoke-LoggedCommand " &$verifyDependenciesScript $ ( $package.DirectoryPath ) /Cargo.toml"
124+ # Temporary fix to exit immediately on failure. LogError should Write-Error
125+ # instead
126+ $command = " &$verifyDependenciesScript $ ( $package.DirectoryPath ) /Cargo.toml"
127+ Invoke-LoggedCommand $command
128+ if ($LastExitCode ) {
129+ Write-Error " Failed to execute $command "
130+ }
70131 }
71132}
0 commit comments