File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Sources/PackageRegistryTool Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,12 @@ extension SwiftPackageRegistryTool {
82
82
@Option ( help: " Access token " )
83
83
var token : String ?
84
84
85
+ @Option (
86
+ name: . customLong( " token-file " ) ,
87
+ help: " Path to the file containing access token "
88
+ )
89
+ var tokenFilePath : AbsolutePath ?
90
+
85
91
@Flag ( help: " Allow writing to netrc file without confirmation " )
86
92
var noConfirm : Bool = false
87
93
@@ -144,6 +150,10 @@ extension SwiftPackageRegistryTool {
144
150
if let token = self . token {
145
151
// User provided token
146
152
storePassword = token
153
+ } else if let tokenFilePath {
154
+ print ( " Reading access token from \( tokenFilePath) . " )
155
+ storePassword = try localFileSystem. readFileContents ( tokenFilePath)
156
+ . trimmingCharacters ( in: . whitespacesAndNewlines)
147
157
} else if let stored = authorizationProvider. authentication ( for: registryURL) ,
148
158
stored. user == storeUsername
149
159
{
You can’t perform that action at this time.
0 commit comments