File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
12
12
import fs from "fs" ;
13
13
import { google } from "googleapis" ;
14
14
import path from "path" ;
15
+ import { fileURLToPath } from 'url' ;
15
16
16
17
const drive = google . drive ( "v3" ) ;
17
18
@@ -176,15 +177,15 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
176
177
} ) ;
177
178
178
179
const credentialsPath = process . env . GDRIVE_CREDENTIALS_PATH || path . join (
179
- path . dirname ( new URL ( import . meta. url ) . pathname ) ,
180
+ path . dirname ( fileURLToPath ( import . meta. url ) ) ,
180
181
"../../../.gdrive-server-credentials.json" ,
181
182
) ;
182
183
183
184
async function authenticateAndSaveCredentials ( ) {
184
185
console . log ( "Launching auth flow…" ) ;
185
186
const auth = await authenticate ( {
186
187
keyfilePath : process . env . GDRIVE_OAUTH_PATH || path . join (
187
- path . dirname ( new URL ( import . meta. url ) . pathname ) ,
188
+ path . dirname ( fileURLToPath ( import . meta. url ) ) ,
188
189
"../../../gcp-oauth.keys.json" ,
189
190
) ,
190
191
scopes : [ "https://www.googleapis.com/auth/drive.readonly" ] ,
You can’t perform that action at this time.
0 commit comments