fix(publisher): allow config for Electron Release Server to be read from envars

This commit is contained in:
CJ Davis 2017-09-21 11:46:53 -04:00 коммит произвёл Mark Lee
Родитель fcdc0a0298
Коммит 50d35374db
2 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -50,6 +50,7 @@ export default async (dir) => {
electronInstallerRedhat: {}, electronInstallerRedhat: {},
s3: {}, s3: {},
github_repository: {}, github_repository: {},
electronReleaseServer: {},
}, forgeConfig); }, forgeConfig);
forgeConfig.make_targets = Object.assign({ forgeConfig.make_targets = Object.assign({
win32: ['squirrel'], win32: ['squirrel'],

Просмотреть файл

@ -23,6 +23,7 @@ const defaults = {
}, },
github_repository: {}, github_repository: {},
s3: {}, s3: {},
electronReleaseServer: {},
}; };
describe('forge-config', () => { describe('forge-config', () => {
@ -54,7 +55,10 @@ describe('forge-config', () => {
expect(conf.s3.secretAccessKey).to.equal(undefined); expect(conf.s3.secretAccessKey).to.equal(undefined);
process.env.ELECTRON_FORGE_S3_SECRET_ACCESS_KEY = 'SecretyThing'; process.env.ELECTRON_FORGE_S3_SECRET_ACCESS_KEY = 'SecretyThing';
process.env.ELECTRON_FORGE_ELECTRON_RELEASE_SERVER_BASE_URL = 'http://example.com';
expect(conf.s3.secretAccessKey).to.equal('SecretyThing'); expect(conf.s3.secretAccessKey).to.equal('SecretyThing');
expect(conf.electronReleaseServer.baseUrl).to.equal('http://example.com');
delete process.env.ELECTRON_FORGE_S3_SECRET_ACCESS_KEY; delete process.env.ELECTRON_FORGE_S3_SECRET_ACCESS_KEY;
delete process.env.ELECTRON_FORGE_ELECTRON_RELEASE_SERVER_BASE_URL;
}); });
}); });