Skip to content

fix(install): update SCRIPT_DIR after clone and guard usage-notice#1387

Closed
latenighthackathon wants to merge 1 commit intoNVIDIA:mainfrom
latenighthackathon:fix/install-script-dir-after-clone
Closed

fix(install): update SCRIPT_DIR after clone and guard usage-notice#1387
latenighthackathon wants to merge 1 commit intoNVIDIA:mainfrom
latenighthackathon:fix/install-script-dir-after-clone

Conversation

@latenighthackathon
Copy link
Copy Markdown
Contributor

@latenighthackathon latenighthackathon commented Apr 3, 2026

Summary

  • Update SCRIPT_DIR to the cloned source directory after the link step in both local-source and GitHub-clone install paths
  • Guard show_usage_notice() against usage-notice.js not existing in the cloned source

Root Cause

When piped via curl | bash, BASH_SOURCE[0] is empty and $0 is bash, so:

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"

resolves to the user's cwd (e.g. /home/u), not the NemoClaw source. After cloning to ~/.nemoclaw/source, SCRIPT_DIR was never updated, so show_usage_notice() looked for usage-notice.js in the wrong directory.

Additionally, the latest tag currently points to b999c0e which predates the usage-notice.js addition in #1290. Even with the correct SCRIPT_DIR, the file won't exist until the tag is moved forward.

Test plan

Tested in Docker (Ubuntu 24.04, clean install, piped via cat install.sh | bash):

  • Unpatched: Cannot find module '/home/testuser/bin/lib/usage-notice.js' (wrong path)
  • SCRIPT_DIR fix only: Correct path but file missing due to stale latest tag
  • Both fixes: Installer completes through to nemoclaw onboard successfully

Closes #1373
Closes #1381

Signed-off-by: latenighthackathon latenighthackathon@users.noreply.github.com

Summary by CodeRabbit

  • Bug Fixes
    • Improved installation reliability by ensuring script paths correctly resolve to their source locations during both local and GitHub-based installations.
    • Enhanced installation robustness with better handling of potentially missing dependencies.

When piped via `curl | bash`, BASH_SOURCE[0] is empty and $0 is
`bash`, so SCRIPT_DIR resolves to the user's cwd instead of the
NemoClaw source directory.  After cloning, SCRIPT_DIR was never
updated, causing show_usage_notice() to look for usage-notice.js
in the wrong location.

Update SCRIPT_DIR to the clone/source directory after the link step
in both the local-source and GitHub-clone install paths.

Also guard show_usage_notice() against the file not existing, since
the `latest` release tag may predate the usage-notice feature.

Closes NVIDIA#1373
Closes NVIDIA#1381

Signed-off-by: latenighthackathon <latenighthackathon@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 20ab95d5-c7ec-4a31-9b52-08b33cf2f9ad

📥 Commits

Reviewing files that changed from the base of the PR and between 54a4faa and 220b7e7.

📒 Files selected for processing (1)
  • install.sh

📝 Walkthrough

Walkthrough

The installer script now correctly resolves paths to bundled resources. Added existence checks for the usage notice file and sets SCRIPT_DIR to appropriate installation directories after building NemoClaw, ensuring subsequent script references resolve correctly.

Changes

Cohort / File(s) Summary
Path Resolution Fixes
install.sh
Added existence check in show_usage_notice() to handle missing usage-notice.js file gracefully. Set SCRIPT_DIR to workspace directory after local builds and to cloned source directory after GitHub installations, fixing incorrect path resolution that caused module-not-found errors during onboarding.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 The paths were lost in the installation flow,
But now they're fixed with a gentle SCRIPT_DIR glow,
No more mysterious missing modules at night,
The installer hops forward—everything's right! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the two main fixes: updating SCRIPT_DIR after clone and guarding the usage-notice check.
Linked Issues check ✅ Passed The PR addresses both #1373 and #1381 by fixing SCRIPT_DIR resolution in piped installs and adding a guard for missing usage-notice.js.
Out of Scope Changes check ✅ Passed The changes are limited to install.sh with modifications directly addressing the linked issues; no unrelated or out-of-scope changes detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@latenighthackathon
Copy link
Copy Markdown
Contributor Author

Closing — this is resolved by #1388 (merged by @kjw3). Same root cause: SCRIPT_DIR not updated after clone when piped. Their fix uses a dedicated NEMOCLAW_SOURCE_ROOT variable and includes a regression test. Thanks @kjw3!

@latenighthackathon latenighthackathon deleted the fix/install-script-dir-after-clone branch April 3, 2026 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Install failure at show_usage_notice Installer failed at onboarding: Cannot find module

1 participant