Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

# Change Log

## 2025-05-06 - CLI 0.17.4

- fix: fully install go sdk in dev mode [#811](https://github.com/hypermodeinc/modus/pull/811)

## 2025-04-29 - Go SDK 0.17.4

- fix: Relax postgresql connString regex to allow host to be templated [#830](https://github.com/hypermodeinc/modus/pull/830)
Expand Down
12 changes: 2 additions & 10 deletions cli/src/commands/dev/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { getAppInfo } from "../../util/appinfo.js";
import { isOnline, withSpinner } from "../../util/index.js";
import { readHypermodeSettings } from "../../util/hypermode.js";
import BuildCommand from "../build/index.js";
import SDKInstallCommand from "../sdk/install/index.js";
import { BaseCommand } from "../../baseCommand.js";

const MANIFEST_FILE = "modus.json";
Expand Down Expand Up @@ -85,16 +86,7 @@ export default class DevCommand extends BaseCommand {
}

if (!(await vi.sdkVersionIsInstalled(sdk, sdkVersion))) {
const sdkText = `Modus ${sdk} SDK ${sdkVersion}`;
await withSpinner(chalk.dim("Downloading and installing " + sdkText), async (spinner) => {
try {
await installer.installSDK(sdk, sdkVersion);
} catch (e) {
spinner.fail(chalk.red(`Failed to download ${sdkText}`));
throw e;
}
spinner.succeed(chalk.dim(`Installed ${sdkText}`));
});
await SDKInstallCommand.run([sdk, sdkVersion, "--no-logo"]);
}

let runtimeVersion = flags.runtime;
Expand Down
25 changes: 24 additions & 1 deletion cli/src/util/versioninfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import chalk from "chalk";
import semver from "semver";
import os from "node:os";
import path from "node:path";
import * as http from "./http.js";
import * as fs from "./fs.js";
Expand Down Expand Up @@ -179,7 +181,28 @@ export async function runtimeReleaseExists(version: string): Promise<boolean> {
}

export async function sdkVersionIsInstalled(sdk: globals.SDK, version: string): Promise<boolean> {
return await fs.exists(getSdkPath(sdk, version));
// normal check for SDK path
const sdkPath = getSdkPath(sdk, version);
const installed = await fs.exists(sdkPath);
if (!installed) {
return false;
}

// extra check for Go build tool, due to prior issue with it not being installed in all cases
if (sdk === globals.SDK.Go) {
const ext = os.platform() === "win32" ? ".exe" : "";
const buildTool = path.join(sdkPath, "modus-go-build" + ext);
if (await fs.exists(buildTool)) {
return true;
}

// SDK installed, but build tool not found, so delete and return false so it can be reinstalled
console.log(chalk.yellow(`ⓘ Detected incomplete installation of Modus Go SDK ${version}. Reinstalling...`));
await fs.rm(sdkPath, { recursive: true, force: true });
return false;
}

return installed;
}

export async function runtimeVersionIsInstalled(version: string): Promise<boolean> {
Expand Down