Skip to content

Enable completion of directories when selecting a compose file #230

@heaysa

Description

@heaysa

docker-compose-read-compose-file completes *.yaml and *.yml filenames but not directories, which must be manually typed if the desired compose file is not in the initial input.I use a custom function to get around this, which may warrant consideration as a feature in docker.el.

(defun docker-compose-read-compose-file (prompt &optional initial-input _history)
  "Wrapper around `read-file-name' forwarding PROMPT and INITIAL-INPUT."
  (read-file-name prompt nil nil t initial-input 
                  (lambda (file-name)
                    (or (file-directory-p file-name)
                        (string-match ".*\\.yml\\|.*\\.yaml" file-name)))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions