-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathconfig.js
21 lines (20 loc) · 814 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,
};
const isUpload = command === 'upload' || !command;
return {
apiConfig,
zipPath: isUpload ? await findSource(flags.source) : undefined,
isUpload,
isPublish: command === 'publish',
autoPublish: flags.autoPublish || !command,
trustedTesters: flags.trustedTesters,
deployPercentage: flags.deployPercentage,
};
}