diff --git a/.gitignore b/.gitignore index ee7a5ba9..e9a6b3ba 100644 --- a/.gitignore +++ b/.gitignore @@ -129,3 +129,6 @@ dist .yarn/build-state.yml .yarn/install-state.gz .pnp.* + +# Idea IDE +.idea diff --git a/README.md b/README.md index 75279b43..cfd83c23 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/lib/utils/verify-plugin.ts b/lib/utils/verify-plugin.ts index 9cc4d64e..2b81c1da 100644 --- a/lib/utils/verify-plugin.ts +++ b/lib/utils/verify-plugin.ts @@ -6,7 +6,7 @@ import { PluginConfig } from '../classes/plugin-config.class.js'; export async function verifyPlugin(config: PluginConfig): Promise { const pluginPath = config.path - ? path.resolve(config.path, config.slug) + ? path.resolve(config.path) : path.resolve('./'); const errors: SemanticReleaseError[] = []; diff --git a/lib/utils/verify-theme.ts b/lib/utils/verify-theme.ts index 142b8a84..6a033047 100644 --- a/lib/utils/verify-theme.ts +++ b/lib/utils/verify-theme.ts @@ -6,7 +6,7 @@ import { PluginConfig } from '../classes/plugin-config.class.js'; export async function verifyTheme(config: PluginConfig): Promise { const themePath = config.path - ? path.resolve(config.path, config.slug) + ? path.resolve(config.path) : path.resolve('./'); const errors: SemanticReleaseError[] = []; diff --git a/test/1-verify-plugin.spec.ts b/test/1-verify-plugin.spec.ts index 6a2f1847..34252705 100644 --- a/test/1-verify-plugin.spec.ts +++ b/test/1-verify-plugin.spec.ts @@ -38,7 +38,7 @@ describe('Plugin verification', () => { { type: 'plugin', slug: 'bad-plugin', - path: './test/fixtures', + path: './test/fixtures/bad-plugin', }, context, ); @@ -56,7 +56,7 @@ describe('Plugin verification', () => { { type: 'plugin', slug: 'bad-version', - path: './test/fixtures', + path: './test/fixtures/bad-version', }, context, ); @@ -73,7 +73,7 @@ describe('Plugin verification', () => { { type: 'plugin', slug: 'other-bad-plugin', - path: './test/fixtures', + path: './test/fixtures/other-bad-plugin', }, context, ); @@ -91,7 +91,7 @@ describe('Plugin verification', () => { { type: 'plugin', slug: 'plugin1', - path: './test/fixtures', + path: './test/fixtures/plugin1', }, context, ), diff --git a/test/1-verify-theme.spec.ts b/test/1-verify-theme.spec.ts index a8d5513d..62085e47 100644 --- a/test/1-verify-theme.spec.ts +++ b/test/1-verify-theme.spec.ts @@ -38,7 +38,7 @@ describe('Theme verification', () => { { type: 'theme', slug: 'bad-theme', - path: './test/fixtures', + path: './test/fixtures/bad-theme', }, context, ); @@ -56,7 +56,7 @@ describe('Theme verification', () => { { type: 'theme', slug: 'bad-theme-version', - path: './test/fixtures', + path: './test/fixtures/bad-theme-version', }, context, ); @@ -73,7 +73,7 @@ describe('Theme verification', () => { { type: 'theme', slug: 'theme-bad-header', - path: './test/fixtures', + path: './test/fixtures/theme-bad-header', }, context, ); @@ -91,7 +91,7 @@ describe('Theme verification', () => { { type: 'theme', slug: 'complete-theme', - path: './test/fixtures', + path: './test/fixtures/complete-theme', }, context, ),