Skip to content

Commit e19c618

Browse files
authored
update temp dir location (#15)
* update temp dir location
1 parent c41228f commit e19c618

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@octomind/debugtopus",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"description": "thin wrapper around ngrok and playwright to run your automagically-maintained tests locally",
55
"main": "./dist/index.js",
66
"type": "commonjs",

src/debugtopus.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Command } from "commander";
2-
import { writeFileSync, mkdirSync, existsSync } from "fs";
2+
import { existsSync, mkdirSync, writeFileSync } from "fs";
33
import { promisify } from "util";
44
import { exec } from "child_process";
55
import { randomUUID } from "crypto";
@@ -43,7 +43,11 @@ export const prepareTestRun = async ({
4343
const code = await getPlaywrightCode(testId, token, url, octomindUrl);
4444

4545
const dirname = __dirname;
46-
const tempDir = path.join(dirname, "..", "temp");
46+
let tempDir = path.join(dirname, "..", "..", "..", "..", "temp");
47+
if (process.env.NODE_ENV === "test") {
48+
tempDir = path.join(dirname, "..", "temp");
49+
}
50+
4751
const outputDir = "output";
4852
if (!existsSync(tempDir)) {
4953
mkdirSync(tempDir);

0 commit comments

Comments
 (0)