diff --git a/deno.json b/deno.json index 7c9fa94..66b5938 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@cross/service", - "version": "1.0.0", + "version": "1.0.1", "fmt": { "lineWidth": 200 }, diff --git a/lib/managers/windows.ts b/lib/managers/windows.ts index ab7e7c2..2ee9db8 100644 --- a/lib/managers/windows.ts +++ b/lib/managers/windows.ts @@ -9,6 +9,7 @@ import { exists, mkdir, unlink, writeFile } from "@cross/fs"; import { cwd, spawn } from "@cross/utils"; import type { InstallServiceOptions, UninstallServiceOptions } from "../service.ts"; import type { ServiceInstallResult, ServiceUninstallResult } from "../result.ts"; +import { CurrentRuntime, Runtime } from "@cross/runtime"; class WindowsService { constructor() {} @@ -128,7 +129,11 @@ class WindowsService { * @returns {string} The generated batch file content as a string. */ async generateConfig(options: InstallServiceOptions): Promise { - const defaultPath = `%PATH%;`; + let defaultPath = "%PATH%;"; + if (CurrentRuntime === Runtime.Deno) { + const denoPath = Deno.execPath(); + defaultPath += `${denoPath};${options.home}\\.deno\\bin`; + } const envPath = options.path ? `${defaultPath};${options.path.join(";")}` : defaultPath; const workingDirectory = options.cwd ? options.cwd : cwd();