Skip to content

Commit

Permalink
fix demo web config
Browse files Browse the repository at this point in the history
  • Loading branch information
jianzfb committed Oct 21, 2024
1 parent 029e274 commit 6381ace
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions antgo/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,12 @@ def main():
with open(os.path.join(antgo_depend_root, 'antgo-web', 'vue.config.js'), 'w') as fp:
fp.write(config_content)

with open(os.path.join(antgo_depend_root, 'antgo-web/src', 'main.js.default'), 'r') as fp:
config_content = fp.read()
config_content = config_content.replace('{DEMONAME}', args.name)
with open(os.path.join(antgo_depend_root, 'antgo-web/src', 'main.js'), 'w') as fp:
fp.write(config_content)

with open(os.path.join(antgo_depend_root, 'antgo-web/src/router', 'index.js.default'), 'r') as fp:
config_content = fp.read()
config_content = config_content.replace('{DEMONAME}', args.name)
Expand Down
10 changes: 8 additions & 2 deletions antgo/pipeline/functional/mixins/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,20 @@ def demo(self, input=[], output=[], title="", description="", default_config=Non

with open(os.path.join(antgo_depend_root, 'antgo-web', 'vue.config.js.default'), 'r') as fp:
config_content = fp.read()
config_content = config_content.replace('{DEMONAME}', args.name)
config_content = config_content.replace('/{DEMONAME}/', '/')
print(config_content)
with open(os.path.join(antgo_depend_root, 'antgo-web', 'vue.config.js'), 'w') as fp:
fp.write(config_content)

with open(os.path.join(antgo_depend_root, 'antgo-web/src', 'main.js.default'), 'r') as fp:
config_content = fp.read()
config_content = config_content.replace('/{DEMONAME}', '/')
with open(os.path.join(antgo_depend_root, 'antgo-web/src', 'main.js'), 'w') as fp:
fp.write(config_content)

with open(os.path.join(antgo_depend_root, 'antgo-web/src/router', 'index.js.default'), 'r') as fp:
config_content = fp.read()
config_content = config_content.replace('{DEMONAME}', args.name)
config_content = config_content.replace('/{DEMONAME}/', '/')
with open(os.path.join(antgo_depend_root, 'antgo-web/src/router', 'index.js'), 'w') as fp:
fp.write(config_content)

Expand Down
2 changes: 1 addition & 1 deletion antgo/version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import unicode_literals
from __future__ import division

version_code = "0.3.0"
version_code = "0.3.1"
version_info = tuple([int(d) for d in version_code.split("-")[0].split(".")])

0 comments on commit 6381ace

Please sign in to comment.