Skip to content

Commit

Permalink
Fix PATH in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexagon committed Apr 21, 2024
1 parent 205c8a4 commit b6263a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cross/service",
"version": "1.0.0",
"version": "1.0.1",
"fmt": {
"lineWidth": 200
},
Expand Down
7 changes: 6 additions & 1 deletion lib/managers/windows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
Expand Down Expand Up @@ -128,7 +129,11 @@ class WindowsService {
* @returns {string} The generated batch file content as a string.
*/
async generateConfig(options: InstallServiceOptions): Promise<string> {
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();

Expand Down

0 comments on commit b6263a0

Please sign in to comment.