forked from fregante/chrome-webstore-upload-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
21 lines (19 loc) · 771 Bytes
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import process from 'node:process';
import findSource from './find-source.js';
export default async function getConfig(command, flags) {
const apiConfig = {
extensionId: flags.extensionId || process.env.EXTENSION_ID,
clientId: flags.clientId || process.env.CLIENT_ID,
clientSecret: flags.clientSecret || process.env.CLIENT_SECRET,
refreshToken: flags.refreshToken || process.env.REFRESH_TOKEN,
};
return {
apiConfig,
zipPath: await findSource(flags.source),
isUpload: command === 'upload' || !command,
isPublish: command === 'publish',
autoPublish: flags.autoPublish || !command,
trustedTesters: flags.trustedTesters,
deployPercentage: flags.deployPercentage,
};
}