Skip to content
This repository was archived by the owner on Feb 26, 2021. It is now read-only.

Commit d2462bb

Browse files
author
cstrap
committed
wip replace
1 parent 69428ba commit d2462bb

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

python_vuejs/django.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,12 @@ def djangofy_vue_project(project):
5757
pakckage_json['scripts']['build'] += ' && djbuild'
5858
f.seek(0)
5959
f.write(json.dumps(pakckage_json, indent=2))
60-
print('TODO: edit `index.json`...')
61-
# TODO:
62-
# edit `index.json` build
63-
# with open('index.json', 'r+'):
64-
"""
65-
// sample:
66-
index: path.resolve(__dirname, '../templates/{project}/index.html'),
67-
assetsRoot: path.resolve(__dirname, '../static'),
68-
assetsSubDirectory: '{project}',
69-
"""
60+
with cd('config'):
61+
with open('index.js', 'r+'):
62+
lines = f.readlines()
63+
f.seek(0)
64+
for line in lines:
65+
f.write(line.replace('../dist/index.html', './templates/{project}/index.html'.format(project=project))
66+
.replace('', '../static')
67+
.replace("assetsSubDirectory: 'static'",
68+
"assetsSubDirectory: '{project}'".format(project=project)))

0 commit comments

Comments
 (0)