Skip to content

Commit 7e1bf32

Browse files
committed
Let the user type in a resource url for OneDrive Business
1 parent b9fc24e commit 7e1bf32

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

onedrive/onedrive.go

+4-6
Original file line numberDiff line numberDiff line change
@@ -142,20 +142,18 @@ func init() {
142142
if service.ServiceAPIVersion == "v2.0" {
143143
resourcesID = append(resourcesID, service.ServiceResourceID)
144144
resourcesURL = append(resourcesURL, service.ServiceEndpointURI)
145+
} else {
146+
// we only support 2.0 API
147+
fs.Infof(nil, "Skipping API %s endpoint %s", service.ServiceAPIVersion, service.ServiceEndpointURI)
145148
}
146-
// we only support 2.0 API
147-
fs.Infof(nil, "Skipping API %s endpoint %s", service.ServiceAPIVersion, service.ServiceEndpointURI)
148149
}
149150

150151
var foundService string
151152
if len(resourcesID) == 0 {
152153
fs.Errorf(nil, "No Service found")
153154
return
154-
} else if len(resourcesID) == 1 {
155-
foundService = resourcesID[0]
156-
} else {
157-
foundService = fs.Choose("Choose resource URL", resourcesID, resourcesURL, false)
158155
}
156+
foundService = fs.Choose("Choose resource URL", resourcesID, resourcesURL, true)
159157

160158
fs.ConfigFileSet(name, configResourceURL, foundService)
161159
oauthBusinessResource = oauth2.SetAuthURLParam("resource", foundService)

0 commit comments

Comments
 (0)