Skip to content

Commit

Permalink
apply_update.py atualizado
Browse files Browse the repository at this point in the history
  • Loading branch information
GuiBrandt committed Feb 19, 2019
1 parent ea5d290 commit f8539f2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 15 additions & 2 deletions apply_update.py
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 .")
2 changes: 0 additions & 2 deletions god/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ def _install_update(update_dir):
Isso envolve resolver dependências com pip e mover os arquivos
baixados para suas respectivas pastas.
TODO: Implementar remoção de arquivos não utilizados
"""

cli.i_am("Instalando dependências...")
Expand Down

0 comments on commit f8539f2

Please sign in to comment.