Skip to content

Commit

Permalink
Fix build errors (google#156)
Browse files Browse the repository at this point in the history
* Fix build errors
* Fix Drive type by importing Drive
  • Loading branch information
campionfellin authored and grant committed May 4, 2018
1 parent faed059 commit 73765e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import 'connect';
import * as del from 'del';
import * as fs from 'fs';
import { google } from 'googleapis';
import { Drive } from 'googleapis/build/src/apis/drive/v3';
import * as mkdirp from 'mkdirp';
const open = require('open');
const path = require('path');
Expand Down Expand Up @@ -329,7 +330,7 @@ commander
.action(async (scriptId: string, versionNumber?: number) => {
if (!scriptId) {
getAPICredentials(async () => {
const drive = google.drive({version: 'v3', auth: oauth2Client});
const drive = google.drive({version: 'v3', auth: oauth2Client}) as Drive;
const { data } = await drive.files.list({
pageSize: 10,
fields: 'files(id, name)',
Expand Down Expand Up @@ -406,7 +407,7 @@ commander
script.projects.updateContent({
scriptId,
resource: { files },
}, {}, (error: any, res: Function) => {
}, {}, (error: any) => {
spinner.stop(true);
if (error) {
console.error(LOG.PUSH_FAILURE);
Expand Down Expand Up @@ -705,7 +706,7 @@ commander
await checkIfOnline();
spinner.setSpinnerTitle(LOG.FINDING_SCRIPTS).start();
getAPICredentials(async () => {
const drive = google.drive({version: 'v3', auth: oauth2Client});
const drive = google.drive({version: 'v3', auth: oauth2Client}) as Drive;
const res = await drive.files.list({
pageSize: 50,
fields: 'nextPageToken, files(id, name)',
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"es2015",
"es5",
"es6",
"es2017"
]
},
"moduleResolution": "node",
Expand Down

0 comments on commit 73765e0

Please sign in to comment.