Skip to content

Commit

Permalink
fix vscode-insiders path for the remote environment
Browse files Browse the repository at this point in the history
I'm using vscode insiders from macOS to develop on remote Linux machine.
When I try to commit edamagit fails because it cannot find code
cli.

 'code-insiders' it is in PATH when running terminal from vscode:
```sh
which code-insiders
/home/ianic/.vscode-server-insiders/bin/9800cf6dd6bf4634889d60720ef46a400f3a7298/bin/remote-cli/code-insiders
```

The problem is that edamagit is looking into `../bin/code-insiders`
instead of `../bin/remote-cli/code-insiders`. So it fails to
find it and
[fallback](https://github.com/kahole/edamagit/blob/e9462afbdad4ed0a84ec3b1d92c6a9eb4dd20aa2/src/commands/commitCommands.ts#L212)
to using `code` from PATH. Which works if insiders version is not used.
In insiders version there is no `code` cli in PATH but
`code-insiders`.

I think that [this](kahole#194) issue
has the same root cause.
  • Loading branch information
ianic authored and Tor Hedin Brønner committed Jan 31, 2024
1 parent cacbd51 commit b26ef2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commands/commitCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function findCodePath(): string {
if (isDarwin) {
codePath = execPath.split(/(?<=\.app)/)[0] + '/Contents/Resources/app/bin/' + codePath;
} else {
codePath = path.join(path.dirname(execPath), 'bin', codePath);
codePath = path.join(path.dirname(execPath), 'bin', (isRemote ? 'remote-cli' : ''), codePath);
}

if (!fs.existsSync(codePath)) {
Expand Down

0 comments on commit b26ef2a

Please sign in to comment.