Skip to content

Commit 98f6b98

Browse files
committed
rename var
1 parent 9105f46 commit 98f6b98

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

node-scripts/update-yt.mjs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import inquirer from 'inquirer';
3535
const SCOPES = ['https://www.googleapis.com/auth/youtube'];
3636
const TOKEN_DIR = 'google-credentials/';
3737
const TOKEN_PATH = TOKEN_DIR + 'credentials.json';
38+
const CLIENT_PATH = TOKEN_DIR + 'client_secret.json';
3839
const OAuth2 = google.auth.OAuth2;
3940

4041
/**
@@ -150,16 +151,14 @@ async function updateYTDesc(videoId, newDescription, service) {
150151

151152
// Load client secrets from a local file.
152153
async function main() {
153-
let content;
154+
let credentials;
154155
try {
155-
content = await fs.promises.readFile(
156-
'google-credentials/client_secret.json'
157-
);
156+
credentials = await fs.promises.readFile(CLIENT_PATH);
158157
} catch (err) {
159158
console.log('Error loading client secret file: ' + err);
160159
return;
161160
}
162-
const auth = await authorize(JSON.parse(content));
161+
const auth = await authorize(JSON.parse(credentials));
163162

164163
const service = google.youtube({
165164
version: 'v3',

0 commit comments

Comments
 (0)