File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ Function Edit-ComposerConfig() {
2828 Set-ComposerAuth
2929}
3030
31- # Function to merge auth.json fragments .
32- Function Get-MergedAuthJson {
31+ # Function to update auth.json.
32+ Function Update-AuthJson {
3333 [CmdletBinding ()]
3434 param (
3535 [Parameter (Mandatory )][string []] $ComposerAuth
@@ -58,7 +58,7 @@ Function Get-MergedAuthJson {
5858 }
5959 }
6060 }
61- return $ existing | ConvertTo-Json - Depth 5
61+ Set-Content - Path $composer_home \auth.json - Value ( $ existing | ConvertTo-Json - Depth 5 )
6262}
6363
6464# Function to setup authentication in composer.
@@ -81,7 +81,7 @@ Function Set-ComposerAuth() {
8181 $composer_auth += ' "github-oauth": {"github.com": "' + $env: GITHUB_TOKEN + ' "}'
8282 }
8383 if ($composer_auth.length ) {
84- Set-Content - Path $composer_home \auth.json - Value ( Get-MergedAuthJson $ composer_auth)
84+ Update-AuthJson $ composer_auth
8585 }
8686}
8787
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ configure_composer() {
4747}
4848
4949# Function to merge auth.json fragments.
50- get_merged_auth_json () {
50+ update_auth_json () {
5151 local auth_file=" $composer_home /auth.json"
5252 local merged
5353 [[ -f " $auth_file " ]] && merged=$( < " $auth_file " ) || merged=' {}'
@@ -62,7 +62,7 @@ get_merged_auth_json() {
6262 end
6363 ' )
6464 done
65- printf ' %s' " $merged "
65+ printf ' %s' " $merged " > " $composer_home /auth.json "
6666}
6767
6868# Function to setup authentication in composer.
@@ -82,7 +82,7 @@ set_composer_auth() {
8282 composer_auth+=( ' "github-oauth": {"github.com": "' " ${GITHUB_TOKEN:- $COMPOSER_TOKEN } " ' "}' )
8383 fi
8484 if (( ${# composer_auth[@]} )) ; then
85- get_merged_auth_json " ${composer_auth[@]} " | tee " $composer_home /auth.json " > /dev/null
85+ update_auth_json " ${composer_auth[@]} "
8686 fi
8787}
8888
You can’t perform that action at this time.
0 commit comments