Skip to content

Commit eaac11e

Browse files
authored
Merge pull request #197 from AntoninoBonanno/master
Fix verify stage when specify path
2 parents 5d759e1 + 380fe63 commit eaac11e

6 files changed

+25
-21
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,6 @@ dist
129129
.yarn/build-state.yml
130130
.yarn/install-state.gz
131131
.pnp.*
132+
133+
# Idea IDE
134+
.idea

README.md

+12-11
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,18 @@ Plugin uses no environment variables, but has a lot of configuration options
5252

5353
### Options
5454

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

6768
### Versioning
6869

lib/utils/verify-plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { PluginConfig } from '../classes/plugin-config.class.js';
66

77
export async function verifyPlugin(config: PluginConfig): Promise<void> {
88
const pluginPath = config.path
9-
? path.resolve(config.path, config.slug)
9+
? path.resolve(config.path)
1010
: path.resolve('./');
1111
const errors: SemanticReleaseError[] = [];
1212

lib/utils/verify-theme.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { PluginConfig } from '../classes/plugin-config.class.js';
66

77
export async function verifyTheme(config: PluginConfig): Promise<void> {
88
const themePath = config.path
9-
? path.resolve(config.path, config.slug)
9+
? path.resolve(config.path)
1010
: path.resolve('./');
1111
const errors: SemanticReleaseError[] = [];
1212

test/1-verify-plugin.spec.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('Plugin verification', () => {
3838
{
3939
type: 'plugin',
4040
slug: 'bad-plugin',
41-
path: './test/fixtures',
41+
path: './test/fixtures/bad-plugin',
4242
},
4343
context,
4444
);
@@ -56,7 +56,7 @@ describe('Plugin verification', () => {
5656
{
5757
type: 'plugin',
5858
slug: 'bad-version',
59-
path: './test/fixtures',
59+
path: './test/fixtures/bad-version',
6060
},
6161
context,
6262
);
@@ -73,7 +73,7 @@ describe('Plugin verification', () => {
7373
{
7474
type: 'plugin',
7575
slug: 'other-bad-plugin',
76-
path: './test/fixtures',
76+
path: './test/fixtures/other-bad-plugin',
7777
},
7878
context,
7979
);
@@ -91,7 +91,7 @@ describe('Plugin verification', () => {
9191
{
9292
type: 'plugin',
9393
slug: 'plugin1',
94-
path: './test/fixtures',
94+
path: './test/fixtures/plugin1',
9595
},
9696
context,
9797
),

test/1-verify-theme.spec.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('Theme verification', () => {
3838
{
3939
type: 'theme',
4040
slug: 'bad-theme',
41-
path: './test/fixtures',
41+
path: './test/fixtures/bad-theme',
4242
},
4343
context,
4444
);
@@ -56,7 +56,7 @@ describe('Theme verification', () => {
5656
{
5757
type: 'theme',
5858
slug: 'bad-theme-version',
59-
path: './test/fixtures',
59+
path: './test/fixtures/bad-theme-version',
6060
},
6161
context,
6262
);
@@ -73,7 +73,7 @@ describe('Theme verification', () => {
7373
{
7474
type: 'theme',
7575
slug: 'theme-bad-header',
76-
path: './test/fixtures',
76+
path: './test/fixtures/theme-bad-header',
7777
},
7878
context,
7979
);
@@ -91,7 +91,7 @@ describe('Theme verification', () => {
9191
{
9292
type: 'theme',
9393
slug: 'complete-theme',
94-
path: './test/fixtures',
94+
path: './test/fixtures/complete-theme',
9595
},
9696
context,
9797
),

0 commit comments

Comments
 (0)