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:
- 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
- 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:
- 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/:
- 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.
At present, using the
splitcommand meaningfully requires that keys in the parent YAML file have an extension i.e.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 validdocker-composefile.This issue suggests a specification that changes this requirement and makes the tool more flexible. The specification is as follows:
.ymlis automatically appended to the key that is being exported as a file. So, the following will result in filesmy_yaml_file1.ymlandmy_yaml_file2.yml.my_text_file1.txt,my_file_with_no_extension,.dotfileandmy_yaml_file3.yml.my_folderandmy_second_folder, each containing a subfolder calledsubfolder.A suggestion would be to implement 1, 2, and 3 first with the possibility of implementing 4 if required.