Skip to content

Remove absolute path check#57

Open
rugk wants to merge 1 commit intocaddyserver:masterfrom
rugk:patch-1
Open

Remove absolute path check#57
rugk wants to merge 1 commit intocaddyserver:masterfrom
rugk:patch-1

Conversation

@rugk
Copy link
Copy Markdown

@rugk rugk commented Jul 9, 2021

Fixes #56

Untested, and as far as I see the spawn thing likely makes it impossible to use, i.e. it does not work as I want, does it?

So just consider this as a first try/starter for you. (I have no experience in VS Code development.)

Fixes caddyserver#56

**Untested**, and as far as I see the `spawn` thing likely makes it impossible to use, i.e. it does not work as I want, does it?

So just consider this as a first try/starter for you. (I have no experience in VS Code development.)
@antedeguemon
Copy link
Copy Markdown

👍 on this.

I was getting the same Invalid executable path for caddy error in my environment (MacOS), and it turned out that I had caddyfile.executable set only as caddy (which is in my $PATH but is not an absolute path).

Updating the executable to /opt/homebrew/bin/caddy solved it. But IMO this check should be removed, as it even contradicts the default caddy executable behaviour, which is relative and not absolute.

if (executablePath !== undefined && executablePath !== null && executablePath !== '') {
if (!path.isAbsolute(executablePath)) {
vscode.window.showInformationMessage('Invalid executable path for caddy.');
return reject();
}
executable = executablePath;
} else {
executable = 'caddy';
}

It might also fix #307 that is affecting Windows users.

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.

Allow any command-line for caddy excutable path to allow Flatpak compatibility

2 participants