Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/ddc_vim/deps.ts>fn.executable

Dark deno-powered completion framework for neovim/Vim8
Very Popular
Go to Latest
function fn.executable
import { fn } from "https://deno.land/x/ddc_vim@v2.2.0/deps.ts";
const { executable } = fn;

This function checks if an executable with the name {expr} exists. {expr} must be the name of the program without any arguments. executable() uses the value of $PATH and/or the normal searchpath for programs. On MS-Windows the ".exe", ".bat", etc. can optionally be included. Then the extensions in $PATHEXT are tried. Thus if "foo.exe" does not exist, "foo.exe.bat" can be found. If $PATHEXT is not set then ".com;.exe;.bat;.cmd" is used. A dot by itself can be used in $PATHEXT to try using the name without an extension. When 'shell' looks like a Unix shell, then the name is also tried without adding an extension. On MS-Windows it only checks if the file exists and is not a directory, not if it's really executable. On MS-Windows an executable in the same directory as Vim is always found. Since this directory is added to $PATH it should also work to execute it |win32-PATH|. The result is a Number: 1 exists 0 does not exist -1 not implemented on this system |exepath()| can be used to get the full path of an executable. Can also be used as a |method|: GetCommand()->executable()

Parameters

denops: Denops
expr: unknown

Returns

Promise<unknown>