|
32 | 32 |
|
33 | 33 | _source_folder = os.path.join(script_dir, "..", "examples", "minimal")
|
34 | 34 |
|
| 35 | + |
| 36 | + |
35 | 37 | # Copy to destination
|
36 | 38 | shutil.copytree(src=_source_folder, dst=_destination,
|
37 |
| - ignore=ignore_patterns('bower_components', 'node_modules')) |
| 39 | + ignore=ignore_patterns('bower_components', 'node_modules', "README.md")) |
| 40 | + |
| 41 | +# Add README |
| 42 | +shutil.copy(src=os.path.join(script_dir, "README_new_add_on.md"), dst=os.path.join(_destination,"README.md")) |
| 43 | + |
| 44 | +# Create needed variations of the add-on name: |
| 45 | + |
| 46 | +# First, the add-on name should only be word-separated by "-". |
| 47 | +_add_on_name = _add_on_name.replace(" ", "-").replace("_", "-") |
| 48 | + |
| 49 | +# JS names should be camelCase:d and contain no "-" |
| 50 | +_cc_tmp = ''.join(x for x in _add_on_name.title() if x.isalpha()) |
| 51 | +_camelCased_add_on_name = (_cc_tmp[0].lower() + _cc_tmp[1:]).replace("-", "") |
| 52 | + |
| 53 | +# References cannot contain any "-" |
| 54 | +_references_add_on_name = _add_on_name.replace("_", "").replace("-", "") |
| 55 | + |
| 56 | +# Actually replace the strings in all the files |
| 57 | + |
| 58 | +# Replace all the capitalized Minimal mentions |
| 59 | +mass_replace(_destination, "Minimal", _add_on_name.capitalize()) |
| 60 | + |
| 61 | +# Replace all the minimalForm type references minimal mentions with camelCase:d _add_on_name |
| 62 | +mass_replace(_destination, "minimalForm", _camelCased_add_on_name + "Form") |
| 63 | + |
| 64 | +# Replace all the html file references with lowercase _add_on_name |
| 65 | +mass_replace(_destination, "angular-schema-form-minimal", "angular-schema-form-" + _add_on_name.lower()) |
| 66 | + |
| 67 | +# Replace all the destination_folders references with lowercase _add_on_name |
| 68 | +mass_replace(_destination, "destination_folder", _add_on_name.lower()) |
| 69 | + |
| 70 | + |
| 71 | +# Replace all the remaining lowercase(references) minimal mentions |
| 72 | +mass_replace(_destination, "minimal", _references_add_on_name.lower()) |
38 | 73 |
|
39 |
| -# Replace all the Minimal mentions |
40 |
| -mass_replace(_destination, "Minimal", _add_on_name.capitalize() ) |
41 |
| -# Replace all the minimal mentions |
42 |
| -mass_replace(_destination, "minimal", _add_on_name.lower()) |
43 | 74 | # Replace all the Optimal BPM mentions
|
44 | 75 | mass_replace(_destination, "Optimal BPM", _add_on_author)
|
45 | 76 |
|
|
0 commit comments