Skip to content

Commit

Permalink
feat: replace bucketName with bucketConfiguration in PluginConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
erikkiralj1 authored Nov 29, 2022
1 parent 687db84 commit 5fc0980
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"conventionalcommits",
"ENOACCESSKEYID",
"ENOSECRETACCESSKEY",
"ENOBUCKETNAME",
"ENOBUCKETCONFIGURATION",
"ENODIRECTORYPATH"
]
}
8 changes: 4 additions & 4 deletions src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ export function getError(code: ErrorCodes): SemanticReleaseError {
)
}

case 'ENOBUCKETNAME': {
case 'ENOBUCKETCONFIGURATION': {
return new SemanticReleaseError(
'No aws bucket name specified.',
'ENOBUCKETNAME',
'An aws bucket name must be specified for at least one branch to successfully upload files.'
'No aws bucket configuration specified.',
'ENOBUCKETCONFIGURATION',
'An aws bucket configuration must be specified for at least one branch to successfully upload files.'
)
}

Expand Down
4 changes: 2 additions & 2 deletions src/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ export async function publish(config: PluginConfig, context: Context) {

const filePaths = await globby(config.directoryPath)

const bucketName = config.bucketName[context.branch.name]
const bucketName = config.bucketConfiguration[context.branch.name]

if(!bucketName) {
throw new Error(`Missing bucket name for ${context.branch.name} branch.
throw new Error(`Missing bucket configuration for ${context.branch.name} branch.
Please check your plugin configuration and add a valid bucket name.`)
}

Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface PluginConfig extends Config {
*
* @default ""
*/
readonly bucketName: Record<string, string>
readonly bucketConfiguration: Record<string, string>
/**
* Path to directory
*
Expand Down Expand Up @@ -53,4 +53,4 @@ export type AWSConfig = {
}

export type ErrorCodes =
'ENOACCESSKEYID' | 'ENOBUCKETNAME' | 'ENODIRECTORYPATH' | 'ENOSECRETACCESSKEY'
'ENOACCESSKEYID' | 'ENOBUCKETCONFIGURATION' | 'ENODIRECTORYPATH' | 'ENOSECRETACCESSKEY'
4 changes: 2 additions & 2 deletions src/verifyConditions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export function verifyConditions(config: PluginConfig, context: Context): void {
errors.push(getError('ENOSECRETACCESSKEY'))
}

if(!Object.keys(config.bucketName).length) {
errors.push(getError('ENOBUCKETNAME'))
if(!Object.keys(config.bucketConfiguration).length) {
errors.push(getError('ENOBUCKETCONFIGURATION'))
}

if (!config.directoryPath) {
Expand Down

0 comments on commit 5fc0980

Please sign in to comment.