Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix update command#339

Merged
Germandrummer92 merged 2 commits intomainfrom
fix-update-command
Jan 19, 2026
Merged

fix update command#339
Germandrummer92 merged 2 commits intomainfrom
fix-update-command

Conversation

@Germandrummer92
Copy link
Member

@Germandrummer92 Germandrummer92 commented Jan 19, 2026

version before update: packages@ /Users/ddraper/.local/packages
└── @octomind/[email protected]


✔ update complete: packages@ /Users/ddraper/.local/packages
└── @octomind/[email protected]

Greptile Summary

Fixed path construction in the update command from path.join(homedir(), "/.local/packages") to path.join(homedir(), ".local", "packages") and added version display before and after the update operation.

  • Corrected improper path construction that mixed absolute path syntax with path.join
  • Added version checking using npm list @octomind/octomind before and after update
  • Silenced npm install output with stdio: "ignore" for cleaner console output
  • Fixed cwd parameter for npm install to use pathToRoot instead of its parent directory
  • Test file has a critical bug: path construction doesn't match the implementation, which will cause test failures

Confidence Score: 2/5

  • This PR has a critical test bug that causes path mismatch between implementation and tests
  • The implementation changes look good, but the test file contains a logical error where the path construction still uses the old format, which doesn't match the updated implementation and will likely cause test failures
  • Pay close attention to tests/tools/update.spec.ts - the path construction must be fixed to match the implementation

Important Files Changed

Filename Overview
src/tools/update.ts Fixed path construction and added version display before/after update
tests/tools/update.spec.ts Updated cwd parameter but path construction still mismatched, missing new version check assertions

Sequence Diagram

sequenceDiagram
    participant User
    participant UpdateFunc as update()
    participant FS as File System
    participant NPM as npm

    User->>UpdateFunc: Call update()
    UpdateFunc->>UpdateFunc: Build path to ~/.local/packages
    UpdateFunc->>FS: Check package.json exists
    alt package.json not found
        FS-->>UpdateFunc: Not found
        UpdateFunc->>User: Exit with error
    end
    
    UpdateFunc->>NPM: Check npm available
    alt npm not found
        NPM-->>UpdateFunc: Not found
        UpdateFunc->>User: Exit with error
    end
    
    UpdateFunc->>NPM: npm list @octomind/octomind
    NPM-->>UpdateFunc: Old version info
    UpdateFunc->>User: Display version before update
    
    UpdateFunc->>NPM: npm install @octomind/octomind@latest
    NPM-->>UpdateFunc: Installation complete
    
    UpdateFunc->>NPM: npm list @octomind/octomind
    NPM-->>UpdateFunc: New version info
    UpdateFunc->>User: Display update complete with new version
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Comments (2)

  1. tests/tools/update.spec.ts, line 16-18 (link)

    logic: path construction doesn't match the implementation in update.ts:10 which uses path.join(homedir(), ".local", "packages")

  2. tests/tools/update.spec.ts, line 33-40 (link)

    style: verify the new npm list @octomind/octomind calls are tested (lines 28, 40 in update.ts)

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@Germandrummer92 Germandrummer92 enabled auto-merge (squash) January 19, 2026 14:00
@Germandrummer92 Germandrummer92 merged commit 59cc2f7 into main Jan 19, 2026
3 checks passed
@Germandrummer92 Germandrummer92 deleted the fix-update-command branch January 19, 2026 14:00
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.

2 participants