Skip to content

Validate libraries.yml #439

@chovanecadam

Description

@chovanecadam

Description

Hello, I was creating my own bashly library with the following libraries.yml file:

all:
  help: Add all library functions
  files:
    - source: src/config.sh
      target: "%{user_lib_dir}/config.%{user_ext}"
    - source: src/ini.sh
      target: "%{user_lib_dir}/ini.%{user_ext}"
    - source: src/msg.sh
      target: "%{user_lib_dir}/msg.%{user_ext}"
    - soruce: src/prompt.sh
      target: "%{user_lib_dir}/prompt.%{user_ext}"
    - source: src/utility.sh
      target: "%{user_lib_dir}/utility.%{user_ext}"

The bashly add --source ./path/to/lib all call was failing with error message Errno::EISDIR - Is a directory @ io_fread - ../bash-lib/. The issue lies in a typo -- the fourth item is misspelled (soruce instead of source). The issue lies here, where the code assumes that source is set. If it isn't, it calls file_contents on the path, which fails, because it is a directory.

I think it would be great to either validate the yml file before processing it, or make a better error message. Would you be willing to implement this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions