Skip to content

Commit

Permalink
fix: set mise.binPath to mise by default
Browse files Browse the repository at this point in the history
  • Loading branch information
hverlin committed Jan 15, 2025
1 parent 9fe175b commit c382d5a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/src/content/docs/reference/Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ Enable/disable mise extension.

##### `mise.binPath`
- **Type:** `string`
- **Default:** `"mise"`

Path to the mise binary (automatically detected on startup).

If set to `mise` (default), it will use `mise` available in `PATH`.

See https://mise.jdx.dev/getting-started.html to install mise.

---
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@
"mise.binPath": {
"order": 2,
"type": "string",
"markdownDescription": "Path to the mise binary (automatically detected on startup).\n\nSee https://mise.jdx.dev/getting-started.html to install mise."
"markdownDescription": "Path to the mise binary (automatically detected on startup).\n\nIf set to `mise` (default), it will use `mise` available in `PATH`.\n\nSee https://mise.jdx.dev/getting-started.html to install mise.",
"default": "mise"
},
"mise.miseEnv": {
"order": 3,
Expand Down
3 changes: 3 additions & 0 deletions src/configuration.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { isDeepStrictEqual } from "node:util";
import { deepMerge } from "@std/collections";
import * as vscode from "vscode";
import { logger } from "./utils/logger";

export const CONFIGURATION_FLAGS = {
enable: "enable",
Expand Down Expand Up @@ -72,6 +73,8 @@ export const getConfiguredBinPath = (): string | undefined => {
};

export const updateBinPath = async (binPath: string) => {
logger.info(`Updating bin path to: ${binPath}`);

await getExtensionConfig().update(
CONFIGURATION_FLAGS.binPath,
binPath,
Expand Down
1 change: 1 addition & 0 deletions src/utils/miseBinLocator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { safeExec } from "./shell";

export async function resolveMisePath(): Promise<string> {
const configuredPath = getConfiguredBinPath();
logger.debug(`Configured mise path: ${configuredPath}`);

if (configuredPath) {
if (await isValidBinary(configuredPath)) {
Expand Down

0 comments on commit c382d5a

Please sign in to comment.