mirror of https://github.com/dapr/cli.git
Use env var for windows install script and remove macos/linux command line (#143)
* Use environment variable for gh user and pat * Remove linux and macos command line
This commit is contained in:
parent
9a84624949
commit
e64192d337
|
@ -3,12 +3,17 @@
|
|||
## Install Dapr CLI
|
||||
|
||||
### Windows
|
||||
|
||||
```
|
||||
powershell -Command "iwr -useb https://raw.githubusercontent.com/dapr/cli/master/install/install.ps1 | iex"
|
||||
```
|
||||
|
||||
### Linux/MacOS
|
||||
Note: Until the repo is public, please use the below command.
|
||||
|
||||
```
|
||||
/usr/bin/bash "$(curl -fsSL https://raw.githubusercontent.com/dapr/cli/master/install/install.sh)"
|
||||
```
|
||||
powershell -Command "$Env:GITHUB_USER='your_github_id'; $Env:GITHUB_TOKEN='your_github_pat_token'; iwr -useb https://raw.githubusercontent.com/dapr/cli/master/install/install.ps1?token=AC2QIRCKXC5TWOYUZLHFMWC5VJ6FI | iex"
|
||||
```
|
||||
|
||||
### Linux/MacOS
|
||||
|
||||
WIP.
|
|
@ -1,8 +1,3 @@
|
|||
param (
|
||||
[string]$GitHubUsername = "",
|
||||
[string]$GitHubToken = ""
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'stop'
|
||||
|
||||
# Constants
|
||||
|
@ -10,11 +5,12 @@ $DaprRoot="c:\dapr"
|
|||
$DaprRuntimeFileName = "dapr.exe"
|
||||
$DaprRuntimePath = "$DaprRoot\$DaprRuntimeFileName"
|
||||
|
||||
if ($GitHubUsername -eq "") {
|
||||
$githubHeader = @{}
|
||||
# Set Github request authentication for basic authentication.
|
||||
if ($Env:GITHUB_USER) {
|
||||
$basicAuth = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($Env:GITHUB_USER + ":" + $Env:GITHUB_TOKEN));
|
||||
$githubHeader = @{"Authorization"="Basic $basicAuth"}
|
||||
} else {
|
||||
$basic = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($GitHubUsername + ":" + $GitHubToken));
|
||||
$githubHeader = @{"Authorization"="Basic $basic"}
|
||||
$githubHeader = @{}
|
||||
}
|
||||
|
||||
if((Get-ExecutionPolicy) -gt 'RemoteSigned' -or (Get-ExecutionPolicy) -eq 'ByPass') {
|
||||
|
|
Loading…
Reference in New Issue