| Conditions | 2 | 
| Total Lines | 29 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | # -*- coding: utf-8 -*-  | 
            ||
| 11 | @pytest.fixture  | 
            ||
| 12 | def hook_shell_script(tmpdir):  | 
            ||
| 13 | script_dir = tmpdir  | 
            ||
| 14 | |||
| 15 |     if sys.platform.startswith('win'): | 
            ||
| 16 | post_gen_hook_file = script_dir / 'post_gen_project.bat'  | 
            ||
| 17 | post_hook_content = textwrap.dedent(  | 
            ||
| 18 | u"""\  | 
            ||
| 19 | @echo off  | 
            ||
| 20 | |||
| 21 | echo post generation hook  | 
            ||
| 22 | echo. >shell_post.txt  | 
            ||
| 23 | """  | 
            ||
| 24 | )  | 
            ||
| 25 | post_gen_hook_file.write_text(post_hook_content, encoding='utf8')  | 
            ||
| 26 | |||
| 27 | else:  | 
            ||
| 28 | post_gen_hook_file = script_dir / 'post_gen_project.sh'  | 
            ||
| 29 | post_hook_content = textwrap.dedent(  | 
            ||
| 30 | u"""\  | 
            ||
| 31 | #!/bin/bash  | 
            ||
| 32 | |||
| 33 | echo 'post generation hook';  | 
            ||
| 34 | touch 'shell_post.txt'  | 
            ||
| 35 | """  | 
            ||
| 36 | )  | 
            ||
| 37 | post_gen_hook_file.write_text(post_hook_content, encoding='utf8')  | 
            ||
| 38 | |||
| 39 | return str(post_gen_hook_file)  | 
            ||
| 40 | |||
| 62 |