mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-02 17:23:40 -05:00
Merge from vscode 2e5312cd61ff99c570299ecc122c52584265eda2
This commit is contained in:
committed by
Anthony Dresser
parent
3603f55d97
commit
7f1d8fc32f
35
extensions/github-authentication/build/generateconfig.js
Normal file
35
extensions/github-authentication/build/generateconfig.js
Normal file
@@ -0,0 +1,35 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const schemes = ['OSS', 'INSIDERS', 'STABLE', 'EXPLORATION', 'VSO', 'VSO_PPE', 'VSO_DEV'];
|
||||
|
||||
function main() {
|
||||
let content = {};
|
||||
|
||||
for (const scheme of schemes) {
|
||||
const id = process.env[`${scheme}_GITHUB_ID`];
|
||||
const secret = process.env[`${scheme}_GITHUB_SECRET`];
|
||||
|
||||
if (id && secret) {
|
||||
content[scheme] = { id, secret };
|
||||
}
|
||||
}
|
||||
|
||||
const githubAppId = process.env.GITHUB_APP_ID;
|
||||
const githubAppSecret = process.env.GITHUB_APP_SECRET;
|
||||
|
||||
if (githubAppId && githubAppSecret) {
|
||||
content.GITHUB_APP = { id: githubAppId, secret: githubAppSecret }
|
||||
}
|
||||
|
||||
if (Object.keys(content).length > 0) {
|
||||
fs.writeFileSync(path.join(__dirname, '../src/common/config.json'), JSON.stringify(content));
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
Reference in New Issue
Block a user