structurizr / dsl

Structurizr DSL
https://docs.structurizr.com/dsl
Apache License 2.0
1.41k stars 266 forks source link

Hidden (e.g. .DS_Store) file causes exception during !include <directory> #308

Closed simonbrowndotje closed 1 year ago

simonbrowndotje commented 1 year ago

Discussed in https://github.com/structurizr/cli/discussions/136

Originally posted by **okamiraner** July 23, 2023 ### Question Hello Documentation says that I can use `!include` for including all .dsl files inside the directory. In fact, when trying to export a workspace, I get the following exception randomly: `$ structurizr-cli export -workspace workspace.dsl -format mermaid` ``` ... com.structurizr.dsl.StructurizrDslParserException: Input length = 1 at line 3: !include model at com.structurizr.dsl.StructurizrDslParser.parse(StructurizrDslParser.java:901) at com.structurizr.dsl.StructurizrDslParser.parse(StructurizrDslParser.java:128) at com.structurizr.cli.export.ExportCommand.run(ExportCommand.java:131) at com.structurizr.cli.StructurizrCliApplication.run(StructurizrCliApplication.java:77) at com.structurizr.cli.StructurizrCliApplication.main(StructurizrCliApplication.java:112) ... ``` Besides, including a single file works 100% of the time, but in breaks he whole point of a modular workspace adding excessive references that duplicate the folder content. Its is hard to identify the problem, since the behaviour changes in different runs with the same files. My directory tree: ``` ├── model │   ├── person.dsl │   └── workspace.dsl ├── view │   └── workspace.dsl └── workspace.dsl ``` and the root file: ``` workspace { model { !include model } views { !include view } } ```
simonbrowndotje commented 1 year ago

@okamiraner thanks for the ZIP file ... you have some hidden .DS_Store files in the folder structure that are causing the issue. I will add some code to deal with this, but in the meantime you may just want to remove them.

okamiraner commented 1 year ago

@okamiraner thanks for the ZIP file ... you have some hidden .DS_Store files in the folder structure that are causing the issue. I will add some code to deal with this, but in the meantime you may just want to remove them.

Thank you! Apologize for the issue being not exactly relevant.