Skip to content

Changing how split command determines filenames #14

@harivyasi

Description

@harivyasi

At present, using the split command meaningfully requires that keys in the parent YAML file have an extension i.e.

my_yaml_file.yml:
  key1: dict
  key2: str

produces a YAML file called my_yaml_file.yml. This then fails if the file is supplied from an external resource, e.g. is a valid docker-compose file.

This issue suggests a specification that changes this requirement and makes the tool more flexible. The specification is as follows:

  1. Extension .yml is automatically appended to the key that is being exported as a file. So, the following will result in files my_yaml_file1.yml and my_yaml_file2.yml.
my_yaml_file1:
  key1: dict
my_yaml_file2:
  key2: str
  1. If it is required that a given extension is used, the following format for key can be used. Following would create four files, namely my_text_file1.txt, my_file_with_no_extension, .dotfile and my_yaml_file3.yml.
./my_text_file1.txt:
./my_file_with_no_extension:
my_yaml_file3:
  key3: float
./.dotfile:
  1. The same can be extended to encode folders by using a trailing slash. The following should create two folders my_folder and my_second_folder, each containing a subfolder called subfolder.
./my_folder/:
./my_folder/subfolder/:
./my_second_folder/subfolder/:
  1. A combination of all of the above is also possible using the following notation:
./my_third_folder/my_yaml_file4:
  key4: int
./my_fourth_folder/./my_file_without_extension

A suggestion would be to implement 1, 2, and 3 first with the possibility of implementing 4 if required.

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