Skip to content
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
7 changes: 4 additions & 3 deletions bin/lib/onboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,6 @@ function getBlueprintMinOpenshellVersion(rootDir = ROOT) {
// Lazy require: yaml is already a dependency via bin/lib/policies.js but
// pulling it at module load would slow down `nemoclaw --help` for users
// who never reach the preflight path.
// eslint-disable-next-line @typescript-eslint/no-require-imports
const YAML = require("yaml");
const blueprintPath = path.join(rootDir, "nemoclaw-blueprint", "blueprint.yaml");
if (!fs.existsSync(blueprintPath)) return null;
Expand Down Expand Up @@ -1786,8 +1785,10 @@ async function preflight() {
console.error("");
console.error(" Upgrade openshell and retry:");
console.error(" https://github.com/NVIDIA/OpenShell/releases");
console.error(" Or remove the existing binary so the installer can re-fetch a current build:");
console.error(" command -v openshell && rm -f \"$(command -v openshell)\"");
console.error(
" Or remove the existing binary so the installer can re-fetch a current build:",
);
console.error(' command -v openshell && rm -f "$(command -v openshell)"');
console.error("");
process.exit(1);
}
Expand Down
16 changes: 9 additions & 7 deletions test/onboard.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,9 @@ describe("onboard helpers", () => {
});

it("regression #1409: leaves Dockerfile defaults when proxy env is unset", () => {
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "nemoclaw-onboard-dockerfile-proxy-default-"));
const tmpDir = fs.mkdtempSync(
path.join(os.tmpdir(), "nemoclaw-onboard-dockerfile-proxy-default-"),
);
const dockerfilePath = path.join(tmpDir, "Dockerfile");
fs.writeFileSync(
dockerfilePath,
Expand Down Expand Up @@ -529,17 +531,17 @@ describe("onboard helpers", () => {

it("regression #1317: getBlueprintMinOpenshellVersion returns null on missing or unparseable blueprint", () => {
// Missing directory
const missingDir = path.join(os.tmpdir(), "nemoclaw-blueprint-missing-" + Date.now().toString());
const missingDir = path.join(
os.tmpdir(),
"nemoclaw-blueprint-missing-" + Date.now().toString(),
);
expect(getBlueprintMinOpenshellVersion(missingDir)).toBe(null);

// Present file, missing field — must NOT block onboard
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "nemoclaw-blueprint-no-field-"));
const blueprintDir = path.join(tmpDir, "nemoclaw-blueprint");
fs.mkdirSync(blueprintDir, { recursive: true });
fs.writeFileSync(
path.join(blueprintDir, "blueprint.yaml"),
'version: "0.1.0"\n',
);
fs.writeFileSync(path.join(blueprintDir, "blueprint.yaml"), 'version: "0.1.0"\n');
try {
expect(getBlueprintMinOpenshellVersion(tmpDir)).toBe(null);
} finally {
Expand Down Expand Up @@ -592,7 +594,7 @@ describe("onboard helpers", () => {
// Sanity check against the real on-disk blueprint so a future edit that
// accidentally drops or breaks the field is caught by CI rather than at
// a user's onboard time.
const repoRoot = path.resolve(__dirname, "..");
const repoRoot = path.resolve(import.meta.dirname, "..");
const v = getBlueprintMinOpenshellVersion(repoRoot);
expect(v).not.toBe(null);
expect(/^[0-9]+\.[0-9]+\.[0-9]+/.test(v)).toBe(true);
Expand Down
Loading