Skip to content

Commit 4e855ad

Browse files
committed
1 parent 6e64ed2 commit 4e855ad

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

lib/prepare.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import path from 'path';
55
import type { Context } from './@types/semantic-release/index.js';
66
import { DefaultConfig } from './default-options.js';
77
import { PluginConfig } from './types.js';
8-
import { normalizeVersion, pipe, setopt, spawn } from './util.js';
8+
import { __dirname, normalizeVersion, pipe, setopt, spawn } from './util.js';
99
import { assertExitCode, isLegacyBuildInterface } from './verify.js';
1010

1111
async function setVersionPy(setupPy: string, version: string) {

lib/util.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { execa, Options, ResultPromise } from 'execa';
22
import path from 'path';
3+
import url from 'url';
34
import { Context } from './@types/semantic-release/index.js';
45

6+
export const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
7+
58
async function normalizeVersion(
69
version: string,
710
options: Options = {},

lib/verify.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import path from 'path';
66
import { Context } from './@types/semantic-release/index.js';
77
import { DefaultConfig } from './default-options.js';
88
import { PluginConfig } from './types.js';
9-
import { pipe, spawn } from './util.js';
9+
import { __dirname, pipe, spawn } from './util.js';
1010

1111
function assertEnvVar(name: string) {
1212
if (!process.env[name]) {

test/prepare.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ describe('prepare: build functions', () => {
3131
legacyInterface: t.useLegacyInterface,
3232
});
3333
await expect(
34-
sDistPackage(config.srcDir, config.distDir, context),
34+
sDistPackage(config.srcDir, config.distDir, pipe(context)),
3535
).resolves.toBe(undefined);
3636
await expect(
37-
bDistPackage(config.srcDir, config.distDir, context),
37+
bDistPackage(config.srcDir, config.distDir, pipe(context)),
3838
).resolves.toBe(undefined);
3939
},
4040
60000,

0 commit comments

Comments
 (0)