Skip to content

Commit 55daf7c

Browse files
refactor: drop requirement of setting GCLOUD_PROJECT (#81)
1 parent 21fc9c2 commit 55daf7c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

asset/snippets/quickstart.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ async function exportAssets(dumpFilePath) {
2323
});
2424

2525
// Your Google Cloud Platform project ID
26-
const projectId = process.env.GCLOUD_PROJECT;
26+
const projectId = await client.getProjectId();
27+
console.log(projectId);
2728
const projectResource = client.projectPath(projectId);
2829

2930
// var dumpFilePath = 'Dump file path, e.g.: gs://<my_bucket>/<my_asset_file>'
@@ -55,7 +56,7 @@ async function batchGetAssetsHistory(assetNames) {
5556
});
5657

5758
// Your Google Cloud Platform project ID
58-
const projectId = process.env.GCLOUD_PROJECT;
59+
const projectId = await client.getProjectId();
5960
const projectResource = client.projectPath(projectId);
6061
// Your asset names, such as //storage.googleapis.com/[YOUR_BUCKET_NAME].
6162
// var assetNames = ['ASSET_NAME1', 'ASSET_NAME2', ...];

0 commit comments

Comments
 (0)