Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit 2d0f873

Browse files
calebkiagebaywet
andauthored
Fix index out of range issue when no args are provided. (#406)
* Fix index out of range issue when no args are provided. Disable nuget steps * Fix release date * Update src/Program.cs Co-authored-by: Vincent Biret <[email protected]> --------- Co-authored-by: Vincent Biret <[email protected]>
1 parent 4a18b84 commit 2d0f873

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed

.azure-pipelines/release-cli.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ stages:
411411
# Nuget tool doesn't work with multi-stage builds
412412
- task: UseDotNet@2
413413
displayName: 'Use .NET 7'
414-
condition: and(succeeded(), ne('${{ parameters.simulate }}', 'true'), eq(variables['IS_NUGET'], 'true'))
414+
condition: and(false, succeeded(), ne('${{ parameters.simulate }}', 'true'), eq(variables['IS_NUGET'], 'true'))
415415
inputs:
416416
version: 7.x
417417

@@ -426,20 +426,20 @@ stages:
426426
inputs:
427427
projects: './src/msgraph-cli.csproj'
428428
arguments: " --no-restore --configuration $(buildConfiguration) --no-incremental"
429-
condition: and(succeeded(), ne('${{ parameters.simulate }}', 'true'), eq(variables['IS_NUGET'], 'true'))
429+
condition: and(false, succeeded(), ne('${{ parameters.simulate }}', 'true'), eq(variables['IS_NUGET'], 'true'))
430430

431431
- pwsh: |
432432
New-Item '$(ARTIFACTS_PATH)' -ItemType Directory -Force
433433
echo "Test file" > '$(ARTIFACTS_PATH)/mgc.dll'
434434
echo "Test file2" > '$(ARTIFACTS_PATH)/mgc.txt'
435-
condition: and(succeeded(), eq('${{ parameters.simulate }}', 'true'), eq(variables['IS_NUGET'], 'true'))
435+
condition: and(false, succeeded(), eq('${{ parameters.simulate }}', 'true'), eq(variables['IS_NUGET'], 'true'))
436436
displayName: Simulate nuget build
437437
438438
- task: DownloadPipelineArtifact@2
439439
inputs:
440440
patterns: build-output-$(rid)/**/*
441441
path: $(WORKING_DIR)
442-
condition: and(succeeded(), eq(variables['SHOULD_SIGN'], 'True'), ne(variables['IS_NUGET'], 'true'))
442+
condition: and(false, succeeded(), eq(variables['SHOULD_SIGN'], 'True'), ne(variables['IS_NUGET'], 'true'))
443443

444444
- task: PowerShell@2
445445
inputs:
@@ -477,7 +477,7 @@ stages:
477477
debugPreference: '$(OUTPUT_PREFERENCE)'
478478
informationPreference: '$(OUTPUT_PREFERENCE)'
479479
displayName: Compute zip name
480-
condition: and(succeeded(), eq(variables['SHOULD_SIGN'], 'True'), ne(variables['IS_NUGET'], 'true'))
480+
condition: and(false, succeeded(), eq(variables['SHOULD_SIGN'], 'True'), ne(variables['IS_NUGET'], 'true'))
481481

482482
- task: PowerShell@2
483483
inputs:
@@ -496,7 +496,7 @@ stages:
496496
debugPreference: '$(OUTPUT_PREFERENCE)'
497497
informationPreference: '$(OUTPUT_PREFERENCE)'
498498
displayName: Extract archive
499-
condition: and(succeeded(), eq(variables['SHOULD_SIGN'], 'True'), ne(variables['IS_NUGET'], 'True'))
499+
condition: and(false, succeeded(), eq(variables['SHOULD_SIGN'], 'True'), ne(variables['IS_NUGET'], 'True'))
500500

501501
- template: templates/prepare-unsigned-executable-darwin.yaml
502502
parameters:
@@ -514,12 +514,12 @@ stages:
514514
- pwsh: |
515515
Write-Host "##vso[task.setvariable variable=ESRP_FILE_PATTERN]$(pattern)"
516516
displayName: Compute ESRP filter pattern Windows/Nuget
517-
condition: and(succeeded(), eq(variables['SHOULD_SIGN'], 'True'), or(startsWith(variables['RUNTIME_ID'], 'win'), eq(variables['IS_NUGET'], 'true')))
517+
condition: and(false, succeeded(), eq(variables['SHOULD_SIGN'], 'True'), or(startsWith(variables['RUNTIME_ID'], 'win'), eq(variables['IS_NUGET'], 'true')))
518518
519519
# ESRP needs .NET 6
520520
- task: UseDotNet@2
521521
displayName: 'Change to .NET 6'
522-
condition: and(succeeded(), ne('${{ parameters.simulate }}', 'true'), eq(variables['IS_NUGET'], 'true'))
522+
condition: and(false, succeeded(), ne('${{ parameters.simulate }}', 'true'), eq(variables['IS_NUGET'], 'true'))
523523
inputs:
524524
version: 6.x
525525

@@ -553,7 +553,7 @@ stages:
553553
dotnet pack ./src/msgraph-cli.csproj --configuration $(buildConfiguration) --output $(SIGN_PATH) --no-build --include-symbols --include-source /p:SymbolPackageFormat=snupkg -v d
554554
workingDirectory: $(Build.SourcesDirectory)
555555
displayName: DotNet pack (nuget)
556-
condition: and(succeeded(), eq(variables['SHOULD_SIGN'], 'True'), ne('${{ parameters.simulate }}', 'true'), eq(variables['Is_NUGET'], 'true'))
556+
condition: and(false, succeeded(), eq(variables['SHOULD_SIGN'], 'True'), ne('${{ parameters.simulate }}', 'true'), eq(variables['IS_NUGET'], 'true'))
557557
558558
- task: EsrpCodeSigning@2
559559
displayName: 'ESRP CodeSigning (Sign Nuget)'
@@ -566,12 +566,12 @@ stages:
566566
Pattern: "*.nupkg"
567567
inlineOperation: $(inlineNugetSignOperation)
568568
SessionTimeout: 20
569-
condition: and(succeeded(), ne('${{ parameters.simulate }}', 'true'), eq(variables['SHOULD_SIGN'], 'True'), eq(variables['IS_NUGET'], 'true'))
569+
condition: and(false, succeeded(), ne('${{ parameters.simulate }}', 'true'), eq(variables['SHOULD_SIGN'], 'True'), eq(variables['IS_NUGET'], 'true'))
570570

571571
- pwsh: |
572572
$artifactsPath = '$(SIGN_PATH)'
573573
Write-Host "##vso[task.setvariable variable=WORKING_DIR]$artifactsPath"
574-
condition: and(succeeded(), eq(variables['SHOULD_SIGN'], 'True'), eq(variables['IS_NUGET'], 'true'))
574+
condition: and(false, succeeded(), eq(variables['SHOULD_SIGN'], 'True'), eq(variables['IS_NUGET'], 'true'))
575575
576576
- task: PowerShell@2
577577
displayName: Simulate ESRP

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### Changed
1313

14+
## [1.1.1] - 2023-12-11
15+
16+
### Added
17+
18+
### Changed
19+
20+
- Fix index out of range issue when no args are provided. [#404]
21+
22+
1423
## [1.1.0] - 2023-11-29
1524

1625
### Added

src/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static async Task<int> Main(string[] args)
4747
Console.InputEncoding = Encoding.UTF8;
4848
Console.OutputEncoding = Encoding.UTF8;
4949
// Replace `me ...` with `users ... --user-id me`
50-
if (args[0] == "me")
50+
if (args.Length > 0 && args[0] == "me")
5151
{
5252
var hasHelp = Array.Exists(args, static x => x == "--help" || x == "-h" || x == "/?");
5353
var newArgs = hasHelp ? args : new string[args.Length + 2];

src/msgraph-cli.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<ImplicitUsings>disable</ImplicitUsings>
88
<Nullable>enable</Nullable>
99
<AssemblyName>mgc</AssemblyName>
10-
<Version>1.1.0</Version>
10+
<Version>1.1.1</Version>
1111
</PropertyGroup>
1212

1313
<PropertyGroup>

0 commit comments

Comments
 (0)