Function: f-slash

f-slash is a byte-compiled function defined in f.el.

Signature

(f-slash PATH)

Documentation

Append slash to PATH unless one already.

Some functions, such as call-process requires there to be an ending slash.

Other relevant functions are documented in the f group.

Shortdoc

;; f
(f-slash "/path/to/file")
    => /path/to/file
  (f-slash "/path/to/dir")
    => /path/to/dir/
  (f-slash "/path/to/dir/")
    => /path/to/dir/

Source Code

;; Defined in ~/.emacs.d/elpa/f-20241003.1131/f.el
(defun f-slash (path)
  "Append slash to PATH unless one already.

Some functions, such as `call-process' requires there to be an
ending slash."
  (if (f-dir-p path)
      (file-name-as-directory path)
    path))