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