File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
1212import fs from "fs" ;
1313import { google } from "googleapis" ;
1414import path from "path" ;
15+ import { fileURLToPath } from 'url' ;
1516
1617const drive = google . drive ( "v3" ) ;
1718
@@ -176,15 +177,15 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
176177} ) ;
177178
178179const credentialsPath = process . env . GDRIVE_CREDENTIALS_PATH || path . join (
179- path . dirname ( new URL ( import . meta. url ) . pathname ) ,
180+ path . dirname ( fileURLToPath ( import . meta. url ) ) ,
180181 "../../../.gdrive-server-credentials.json" ,
181182) ;
182183
183184async function authenticateAndSaveCredentials ( ) {
184185 console . log ( "Launching auth flow…" ) ;
185186 const auth = await authenticate ( {
186187 keyfilePath : process . env . GDRIVE_OAUTH_PATH || path . join (
187- path . dirname ( new URL ( import . meta. url ) . pathname ) ,
188+ path . dirname ( fileURLToPath ( import . meta. url ) ) ,
188189 "../../../gcp-oauth.keys.json" ,
189190 ) ,
190191 scopes : [ "https://www.googleapis.com/auth/drive.readonly" ] ,
You can’t perform that action at this time.
0 commit comments