51 lines
1.3 KiB
Python
51 lines
1.3 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
创建Android风格的玩Android Uniapp项目
|
|
"""
|
|
|
|
import os
|
|
import shutil
|
|
from pathlib import Path
|
|
|
|
def create_project_structure():
|
|
"""创建项目结构"""
|
|
project_dir = '/home/ubuntu/wanandroid/uniapp_android'
|
|
|
|
# 创建目录
|
|
directories = [
|
|
'pages/index',
|
|
'pages/project',
|
|
'pages/wxarticle',
|
|
'pages/tree',
|
|
'pages/mine',
|
|
'components',
|
|
'static/images/icons',
|
|
'unpackage',
|
|
'utils',
|
|
'styles'
|
|
]
|
|
|
|
for directory in directories:
|
|
os.makedirs(os.path.join(project_dir, directory), exist_ok=True)
|
|
|
|
print(f"✅ 创建项目目录: {project_dir}")
|
|
return project_dir
|
|
|
|
def main():
|
|
"""主函数"""
|
|
print("开始创建Android风格Uniapp项目...")
|
|
project_dir = create_project_structure()
|
|
print(f"📁 项目位置: {project_dir}")
|
|
|
|
# 列出创建的文件
|
|
print("\n📋 项目结构:")
|
|
for root, dirs, files in os.walk(project_dir):
|
|
level = root.replace(project_dir, '').count(os.sep)
|
|
indent = ' ' * 2 * level
|
|
print(f'{indent}{os.path.basename(root)}/')
|
|
subindent = ' ' * 2 * (level + 1)
|
|
for file in files:
|
|
print(f'{subindent}{file}')
|
|
|
|
if __name__ == '__main__':
|
|
main() |