diff --git a/example/README.md b/example/README.md index 44bc8a9e2c519412a4aca746ca5c71a9d49b36fb..113ac88526addf98475f9bda47dbe5afa41dea91 100644 --- a/example/README.md +++ b/example/README.md @@ -1,15 +1,12 @@ # example -Example box. Not compiled. Keep four lines in same order. +This is description of the box. It will be copied. Keep it short and single-line. Don't remove the line break before. Version: 1.0 -This section will be automatically replaced by `python make.py` with auto-generated -content of Vagrantfile that will refer to this box. +Write what this box consists of and how it behaves. +First four lines have a special meaning - dont move them around. Change only version number, not the word. --- -Usage in Vagrantfile: -``` -config.vm.box = "henrietta/example" -config.vm.box_url = "http://dev.dms-serwis.com.pl/vagrant/example.box" -``` +This section will be automatically replaced by `python make.py` with auto-generated +content of Vagrantfile that will refer to this box. diff --git a/make.py b/make.py index 824a716498e4f8f277ed91c0b380c878ba854e58..cde0d7bbf72957b9c8b2b810a439ee94289262cd 100644 --- a/make.py +++ b/make.py @@ -36,7 +36,7 @@ def writefile(content, path, prefix=None, lines=False): with open(path, 'w' if lines else 'wb') as f: if lines: - f.writelines([q+'\n' for q in content]) + f.writelines([q+os.linesep for q in content]) else: if not isinstance(content, list): content = [content] @@ -99,7 +99,7 @@ build_$BOX: after_script: - vagrant destroy -f - cd .. -'''.replace('$BOX', box).replace('$PREFIX', PREFIX)) +'''.replace('$BOX', box).replace('$PREFIX', PREFIX).replace('\n', os.linesep)) if len(gitlabci) == 0: gitlabci = ['''check_validity: @@ -111,7 +111,7 @@ build_$BOX: - grep "1.0" metadata.json - grep "test" metadata.json - cd .. -'''] +'''.replace('\n', os.linesep)] writefile(gitlabci, '.gitlab-ci.yml') @@ -164,7 +164,7 @@ First four lines have a special meaning - dont move them around. Change only ver This section will be automatically replaced by `python make.py` with auto-generated content of Vagrantfile that will refer to this box. -'''.replace('$BOX', box).replace('$PREFIX', PREFIX), 'README.md', box) +'''.replace('$BOX', box).replace('$PREFIX', PREFIX).replace('\n', os.linesep), 'README.md', box) writefile('''#!/bin/bash