Skip to content

Commit

Permalink
Fix empty folder after autoupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
张国晔 committed Jun 27, 2016
1 parent caf31bd commit 8bdf930
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions code/default/launcher/update_from_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,12 @@ def overwrite(xxnet_version, xxnet_unzip_path):
for root, subdirs, files in os.walk(xxnet_unzip_path):
relate_path = root[len(xxnet_unzip_path)+1:]
target_relate_path = relate_path
if target_relate_path.startswith("code\\default"):
target_relate_path = "code\\" + xxnet_version + relate_path[12:]
if sys.platform == 'win32':
if target_relate_path.startswith("code\\default"):
target_relate_path = "code\\" + xxnet_version + relate_path[12:]
else:
if target_relate_path.startswith("code/default"):
target_relate_path = "code/" + xxnet_version + relate_path[12:]

for subdir in subdirs:
if relate_path == "code" and subdir == "default":
Expand Down
2 changes: 1 addition & 1 deletion start
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ else
fi


if [ ! -d "code/$VERSION" ]; then
if [ ! -f "code/$VERSION/launcher/start.py" ]; then
VERSION="default"
fi
echo "XX-Net version:$VERSION"
Expand Down
4 changes: 2 additions & 2 deletions start.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Function CurrentVersion()
Set objFileToRead = CreateObject("Scripting.FileSystemObject").OpenTextFile(strVersionFile,1)
CurrentVersion = objFileToRead.ReadLine()

version_path = strCurrentPath & "/code/" & CurrentVersion
If( Not fso.FolderExists(version_path) ) Then
version_path = strCurrentPath & "/code/" & CurrentVersion & "/launcher/start.py"
If( Not fso.FileExists(version_path) ) Then
CurrentVersion = "default"
End If

Expand Down

0 comments on commit 8bdf930

Please sign in to comment.