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() {
28
28
Set-ComposerAuth
29
29
}
30
30
31
- # Function to merge auth.json fragments .
32
- Function Get-MergedAuthJson {
31
+ # Function to update auth.json.
32
+ Function Update-AuthJson {
33
33
[CmdletBinding ()]
34
34
param (
35
35
[Parameter (Mandatory )][string []] $ComposerAuth
@@ -58,7 +58,7 @@ Function Get-MergedAuthJson {
58
58
}
59
59
}
60
60
}
61
- return $ existing | ConvertTo-Json - Depth 5
61
+ Set-Content - Path $composer_home \auth.json - Value ( $ existing | ConvertTo-Json - Depth 5 )
62
62
}
63
63
64
64
# Function to setup authentication in composer.
@@ -81,7 +81,7 @@ Function Set-ComposerAuth() {
81
81
$composer_auth += ' "github-oauth": {"github.com": "' + $env: GITHUB_TOKEN + ' "}'
82
82
}
83
83
if ($composer_auth.length ) {
84
- Set-Content - Path $composer_home \auth.json - Value ( Get-MergedAuthJson $ composer_auth)
84
+ Update-AuthJson $ composer_auth
85
85
}
86
86
}
87
87
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ configure_composer() {
47
47
}
48
48
49
49
# Function to merge auth.json fragments.
50
- get_merged_auth_json () {
50
+ update_auth_json () {
51
51
local auth_file=" $composer_home /auth.json"
52
52
local merged
53
53
[[ -f " $auth_file " ]] && merged=$( < " $auth_file " ) || merged=' {}'
@@ -62,7 +62,7 @@ get_merged_auth_json() {
62
62
end
63
63
' )
64
64
done
65
- printf ' %s' " $merged "
65
+ printf ' %s' " $merged " > " $composer_home /auth.json "
66
66
}
67
67
68
68
# Function to setup authentication in composer.
@@ -82,7 +82,7 @@ set_composer_auth() {
82
82
composer_auth+=( ' "github-oauth": {"github.com": "' " ${GITHUB_TOKEN:- $COMPOSER_TOKEN } " ' "}' )
83
83
fi
84
84
if (( ${# composer_auth[@]} )) ; then
85
- get_merged_auth_json " ${composer_auth[@]} " | tee " $composer_home /auth.json " > /dev/null
85
+ update_auth_json " ${composer_auth[@]} "
86
86
fi
87
87
}
88
88
You can’t perform that action at this time.
0 commit comments