Skip to content

Commit

Permalink
Merge pull request #197 from AntoninoBonanno/master
Browse files Browse the repository at this point in the history
Fix verify stage when specify path
  • Loading branch information
seebeen committed Jan 18, 2024
2 parents 5d759e1 + 380fe63 commit eaac11e
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,6 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# Idea IDE
.idea
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,18 @@ Plugin uses no environment variables, but has a lot of configuration options

### Options

| Options | Description | Default |
|-------------------|------------------------------------------------------------|-----------------------------------------------------------------------|
| `type` | Type of the package to create. Can be `plugin` or `theme` | None. **You must set this explicitly** |
| `slug` | Package slug. | None. **You must set this explicitly** |
| `withAssets` | Does the package have assets (screenshots, banners, logo) | `false` |
| `withReadme` | Does the package have a readme.txt file | `false` |
| `withVersionFile` | Do we need to create a file with the next release version | `true` |
| `releasePath` | Base path for all of the release files | `/tmp/wp-release` |
| `versionFiles` | Array of additional files containing the package version. | `[]` |
| `include` | Files to include in the package zip file. | `**/*` |
| `exclude` | Files to exclude from the package zip file | List of files and folders defined in [constants.ts](lib/constants.ts) |
| Options | Description | Default |
|-------------------|-----------------------------------------------------------|-----------------------------------------------------------------------|
| `type` | Type of the package to create. Can be `plugin` or `theme` | None. **You must set this explicitly** |
| `slug` | Package slug. | None. **You must set this explicitly** |
| `path` | The path of root folder that contains plugin or theme | `./` |
| `withAssets` | Does the package have assets (screenshots, banners, logo) | `false` |
| `withReadme` | Does the package have a readme.txt file | `false` |
| `withVersionFile` | Do we need to create a file with the next release version | `true` |
| `releasePath` | Base path for all of the release files | `/tmp/wp-release` |
| `versionFiles` | Array of additional files containing the package version. | `[]` |
| `include` | Files to include in the package zip file. | `**/*` |
| `exclude` | Files to exclude from the package zip file | List of files and folders defined in [constants.ts](lib/constants.ts) |

### Versioning

Expand Down
2 changes: 1 addition & 1 deletion lib/utils/verify-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { PluginConfig } from '../classes/plugin-config.class.js';

export async function verifyPlugin(config: PluginConfig): Promise<void> {
const pluginPath = config.path
? path.resolve(config.path, config.slug)
? path.resolve(config.path)
: path.resolve('./');
const errors: SemanticReleaseError[] = [];

Expand Down
2 changes: 1 addition & 1 deletion lib/utils/verify-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { PluginConfig } from '../classes/plugin-config.class.js';

export async function verifyTheme(config: PluginConfig): Promise<void> {
const themePath = config.path
? path.resolve(config.path, config.slug)
? path.resolve(config.path)
: path.resolve('./');
const errors: SemanticReleaseError[] = [];

Expand Down
8 changes: 4 additions & 4 deletions test/1-verify-plugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('Plugin verification', () => {
{
type: 'plugin',
slug: 'bad-plugin',
path: './test/fixtures',
path: './test/fixtures/bad-plugin',
},
context,
);
Expand All @@ -56,7 +56,7 @@ describe('Plugin verification', () => {
{
type: 'plugin',
slug: 'bad-version',
path: './test/fixtures',
path: './test/fixtures/bad-version',
},
context,
);
Expand All @@ -73,7 +73,7 @@ describe('Plugin verification', () => {
{
type: 'plugin',
slug: 'other-bad-plugin',
path: './test/fixtures',
path: './test/fixtures/other-bad-plugin',
},
context,
);
Expand All @@ -91,7 +91,7 @@ describe('Plugin verification', () => {
{
type: 'plugin',
slug: 'plugin1',
path: './test/fixtures',
path: './test/fixtures/plugin1',
},
context,
),
Expand Down
8 changes: 4 additions & 4 deletions test/1-verify-theme.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('Theme verification', () => {
{
type: 'theme',
slug: 'bad-theme',
path: './test/fixtures',
path: './test/fixtures/bad-theme',
},
context,
);
Expand All @@ -56,7 +56,7 @@ describe('Theme verification', () => {
{
type: 'theme',
slug: 'bad-theme-version',
path: './test/fixtures',
path: './test/fixtures/bad-theme-version',
},
context,
);
Expand All @@ -73,7 +73,7 @@ describe('Theme verification', () => {
{
type: 'theme',
slug: 'theme-bad-header',
path: './test/fixtures',
path: './test/fixtures/theme-bad-header',
},
context,
);
Expand All @@ -91,7 +91,7 @@ describe('Theme verification', () => {
{
type: 'theme',
slug: 'complete-theme',
path: './test/fixtures',
path: './test/fixtures/complete-theme',
},
context,
),
Expand Down

0 comments on commit eaac11e

Please sign in to comment.