Skip to content

Commit 45ab203

Browse files
committed
removed unused imports and added IExecuteOptions
1 parent b2f51a2 commit 45ab203

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/constants.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ export enum Environment {
1717
UNIX = "unix",
1818
WIN = "win32",
1919
}
20+
21+
export interface IExecuteOptions {
22+
timeout?: number;
23+
}

src/executor.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
"use strict";
22

33
import { platform, tmpdir } from "os";
4-
import { writeFileSync, unlinkSync, mkdirSync, rmdirSync } from "fs";
4+
import { writeFileSync, mkdirSync, rmdirSync } from "fs";
55
import { exec } from "child_process";
66
import { Language, Environment } from "./constants";
77
import path from "path";
88

9-
const uniqueFilename = require("unique-filename");
10-
119
function parseEnvironment(platform: string): Environment {
1210
if (platform === "win32") {
1311
return Environment.WIN;
@@ -71,7 +69,9 @@ export default async function execute(
7169
// run command
7270
exec(runcmd, (err, stdout, stderr) => {
7371
// Delete created folder
74-
rmdirSync(tempFolder, { recursive: true });
72+
try {
73+
rmdirSync(tempFolder, { recursive: true });
74+
} catch (e) {}
7575

7676
if (stderr) {
7777
// Remove newline from stderr

0 commit comments

Comments
 (0)