-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
15 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,29 @@ | ||
"""Aplica a última atualização baixada | ||
TODO: Implementar remoção de arquivos não utilizados""" | ||
|
||
import os | ||
import os.path | ||
|
||
if os.path.isdir(".update"): | ||
os.system("move .update\\*.* .\\ >nul 2>nul") | ||
|
||
# Atualiza a pasta raíz | ||
os.system("move /Y .update\\*.* .\\ >nul 2>nul") | ||
|
||
# Cria e atualiza os subdiretórios | ||
for subdir in os.walk(".update"): | ||
dirname = subdir[0].replace(".update\\", '') | ||
|
||
os.system( | ||
f"if not exist .\\{dirname}" + | ||
f" mkdir .\\{dirname} >nul 2>nul") | ||
|
||
os.system( | ||
f"move .update\\{dirname}\\*.* .\\{dirname}\\ " + | ||
f"move /Y .update\\{dirname}\\*.* .\\{dirname}\\ " + | ||
">nul 2>nul") | ||
|
||
# Some com a .update | ||
os.system("rmdir .update /s /q >nul 2>nul") | ||
|
||
# Roda o god de novo | ||
os.system("start python .") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters