Commit 7d68940
Update CLI download scripts to set global channel on install (dotnet#13504)
* Initial plan
* Update CLI download scripts to set global channel on install
Added functionality to save the selected channel to globalsettings.json
when installing the Aspire CLI using quality-based downloads.
- Added map_quality_to_channel function to bash script to convert quality
(release/staging/dev) to channel name (stable/staging/daily)
- Added save_global_channel_setting function to bash script to write the
channel to ~/.aspire/globalsettings.json
- Added ConvertTo-ChannelName function to PowerShell script
- Added Save-GlobalChannelSetting function to PowerShell script
- Both scripts now save the channel setting after successful installation
(only when using quality-based downloads, not when specifying version)
Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
* Simplify home directory detection in Save-GlobalChannelSetting
Remove redundant $IsWindows check as $env:USERPROFILE fallback handles
all cases.
Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
* Add channel setting to get-aspire-cli-pr scripts
- Added save_global_channel_setting function to get-aspire-cli-pr.sh
- Added Save-GlobalChannelSetting function to get-aspire-cli-pr.ps1
- Both PR scripts now save channel as 'pr-<PR_NUMBER>' after install
- Fixed PowerShell 5.1 compatibility for ConvertFrom-Json -AsHashtable
- Added verbose logging when jq fails to parse settings file
Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
* Remove channel key for release/stable builds instead of setting it
When installing the release/stable channel, instead of setting the channel
to "stable", the channel key is now removed from the config file entirely.
This prevents the creation of a nuget.config file.
- Added remove_global_channel_setting function to get-aspire-cli.sh
- Added Remove-GlobalChannelSetting function to get-aspire-cli.ps1
- Updated logic to remove channel for stable, save for other channels
Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com>
* Refactor global settings to use aspire config CLI commands
- Renamed save_global_channel_setting to save_global_settings
- Renamed Save-GlobalChannelSetting to Save-GlobalSettings
- Renamed remove_global_channel_setting to remove_global_settings
- Renamed Remove-GlobalChannelSetting to Remove-GlobalSettings
- Now uses 'aspire config set -g key value' and 'aspire config unset -g key'
- Added fallback to direct file edit if CLI commands fail
- Added expected schema comments to all functions
Co-authored-by: radical <95136+radical@users.noreply.github.com>
* Remove fallback to direct file editing for global config
Removed the fallback logic that would directly edit the globalsettings.json
file when CLI commands fail. Now the scripts only use `aspire config set -g`
and `aspire config unset -g` commands without any fallback.
Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
* Change 'aspire config unset' to 'aspire config delete'
Fixed the command to use the correct 'aspire config delete -g' command
instead of the non-existent 'aspire config unset -g'.
Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com>
* Suppress command output and use Verbose level for errors
- Changed `$output = ...` to `$null = ...` to suppress command output
- Changed error messages from Warning to Verbose level
- Applied to both get-aspire-cli.ps1 and get-aspire-cli-pr.ps1
Co-authored-by: radical <1472+radical@users.noreply.github.com>
* Fix output handling: keep output/warnings for set, verbose for delete
- Revert get-aspire-cli.ps1 Save-GlobalSettings to keep output and use Warning
- Revert get-aspire-cli-pr.ps1 Save-GlobalSettings to keep output and use Warning
- Update get-aspire-cli.ps1 Remove-GlobalSettings to log output at Verbose level
- Update get-aspire-cli.sh remove_global_settings to log output at verbose level
Co-authored-by: radical <1472+radical@users.noreply.github.com>
* Improve output handling for Save-GlobalSettings
- On success: log output at Verbose level
- On failure: include output in the warning message
- Applied to both get-aspire-cli.ps1 and get-aspire-cli.sh
Co-authored-by: radical <1472+radical@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
Co-authored-by: mitchdenny <513398+mitchdenny@users.noreply.github.com>
Co-authored-by: radical <95136+radical@users.noreply.github.com>
Co-authored-by: radical <1472+radical@users.noreply.github.com>1 parent 259bbee commit 7d68940
File tree
4 files changed
+277
-3
lines changed- eng/scripts
4 files changed
+277
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
593 | 624 | | |
594 | 625 | | |
595 | 626 | | |
| |||
1096 | 1127 | | |
1097 | 1128 | | |
1098 | 1129 | | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
1099 | 1139 | | |
1100 | 1140 | | |
1101 | 1141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
411 | 441 | | |
412 | 442 | | |
413 | 443 | | |
| |||
1008 | 1038 | | |
1009 | 1039 | | |
1010 | 1040 | | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
1011 | 1054 | | |
1012 | 1055 | | |
1013 | 1056 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
602 | 602 | | |
603 | 603 | | |
604 | 604 | | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
605 | 681 | | |
606 | 682 | | |
607 | 683 | | |
| |||
972 | 1048 | | |
973 | 1049 | | |
974 | 1050 | | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
975 | 1055 | | |
976 | 1056 | | |
977 | 1057 | | |
978 | 1058 | | |
979 | | - | |
980 | | - | |
981 | | - | |
982 | 1059 | | |
983 | 1060 | | |
984 | 1061 | | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
985 | 1075 | | |
986 | 1076 | | |
987 | 1077 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
457 | 545 | | |
458 | 546 | | |
459 | 547 | | |
| |||
908 | 996 | | |
909 | 997 | | |
910 | 998 | | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
911 | 1012 | | |
912 | 1013 | | |
913 | 1014 | | |
| |||
0 commit comments