Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,22 @@ def read_union_apps_file(install_app_path):
return json.load(f)


def check_symlink_exists(symlink_path):
if os.path.islink(symlink_path):
return True
else:
return False


def create_current_link_to_app(target_path, symlink_path):
if check_symlink_exists(symlink_path):
os.remove(symlink_path)
try:
os.symlink(target_path, symlink_path)
except OSError as e:
raise RuntimeError("link file err: {}..".format(e))


def link_install_app_static_file(install_app_path):
# 读取union-apps.json文件
union_apps = read_union_apps_file(install_app_path)
Expand All @@ -171,6 +187,11 @@ def link_install_app_static_file(install_app_path):

if not os.path.exists(current_app_path_public):
os.makedirs(current_app_path_public)
link_file_path = os.path.join(_DEPENDENCIES_LOCK_BASE_PATH, _MICRO_APPS_FOLDER,
subdir_snippet, app_id, "current")
create_current_link_to_app(current_app_path_public, link_file_path)

### app的版本号加上current软链

print u"current app path: {}, current_app_path_public: {}".format(current_app_path, current_app_path_public)

Expand Down