-
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
1 parent
81b0570
commit 795cd95
Showing
20 changed files
with
217 additions
and
60 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
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,8 +1,8 @@ | ||
from .update_projects import update_projects | ||
from .ncu_update_projects import ncu_update_projects | ||
from .projects_update import projects_update | ||
from .ncu_update import ncu_update | ||
from .get_cli_version import get_cli_version | ||
from .check_outdated import check_outdated | ||
from .check_status import check_status | ||
|
||
# Exportando funções/módulos | ||
__all__ = ["update_projects", "ncu_update_projects", "get_cli_version", "check_outdated", "check_status"] | ||
__all__ = ["projects_update", "ncu_update", "get_cli_version", "check_outdated", "check_status"] |
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,22 +1,23 @@ | ||
import os | ||
import subprocess | ||
import i18n | ||
|
||
# Função para verificar dependências desatualizadas em todos os projetos | ||
def check_outdated(base_dir): | ||
for dir in os.listdir(base_dir): | ||
full_path = os.path.join(base_dir, dir) | ||
if os.path.isdir(full_path): | ||
print("Entrando no diretório:", full_path) | ||
print(i18n.t('check_outdated.entering_directory', fullpath=full_path)) | ||
os.chdir(full_path) | ||
|
||
try: | ||
print("Rodando 'outdated' em", full_path) | ||
print(i18n.t('check_outdated.running_outdated', fullpath=full_path)) | ||
subprocess.run(['npm', 'outdated'], check=True) | ||
|
||
except subprocess.CalledProcessError as e: | ||
print(f"Erro ao verificar dependências desatualizadas em {full_path}:") | ||
print(i18n.t('check_outdated.error', fullpath=full_path)) | ||
print(e.stderr) | ||
|
||
os.chdir('..') | ||
|
||
print("Verificação concluída.") | ||
print(i18n.t('check_status.complete_status')) |
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,22 +1,23 @@ | ||
import os | ||
import subprocess | ||
import i18n | ||
|
||
# Função para verificar o status do Git em todos os projetos | ||
def check_status(base_dir): | ||
for dir in os.listdir(base_dir): | ||
full_path = os.path.join(base_dir, dir) | ||
if os.path.isdir(full_path): | ||
print("Entrando no diretório:", full_path) | ||
print(i18n.t('check_status.entering_directory', fullpath=full_path)) | ||
os.chdir(full_path) | ||
|
||
try: | ||
print("Verificando o status do Git em", full_path) | ||
print(i18n.t('check_status.checking_git_status', fullpath=full_path)) | ||
subprocess.run(['git', 'status'], check=True) | ||
|
||
except subprocess.CalledProcessError as e: | ||
print(f"Erro ao verificar o status do Git em {full_path}:") | ||
print(i18n.t('check_status.git_error', fullpath=full_path)) | ||
print(e.stderr) | ||
|
||
os.chdir('..') | ||
print("Verificação de status do Git concluída.") | ||
|
||
print(i18n.t('check_status.complete_status')) |
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,8 +1,9 @@ | ||
from importlib.metadata import version | ||
import i18n | ||
|
||
# Função para exibir a versão do programa | ||
def get_cli_version(): | ||
try: | ||
return version('gitman') | ||
print(i18n.t('comman.version', version=version('gitman'))) | ||
except Exception: | ||
return "Versão desconhecida" | ||
print(i18n.t('comman.version_not_found')) |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
en: | ||
entering_directory: "Entering directory: %{fullpath}" | ||
running_outdated: "Running 'outdated' in %{fullpath}" | ||
error: "Error checking outdated dependencies in %{fullpath}:" | ||
complete_check: "Check completed." |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pt: | ||
entering_directory: "Entrando no diretório: %{fullpath}" | ||
running_outdated: "Rodando 'outdated' em %{fullpath}" | ||
error: "Erro ao verificar dependências desatualizadas em %{fullpath}:" | ||
complete_check: "Verificação concluída." |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
en: | ||
entering_directory: "Entering directory: %{fullpath}" | ||
checking_git_status: "Checking Git status in %{fullpath}" | ||
git_error: "Error checking Git status in %{fullpath}:" | ||
complete_status: "Git status check completed." |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pt: | ||
entering_directory: "Entrando no diretório: %{fullpath}" | ||
checking_git_status: "Verificando o status do Git em %{fullpath}" | ||
git_error: "Erro ao verificar o status do Git em %{fullpath}:" | ||
complete_status: "Verificação de status do Git concluída." |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
en: | ||
version: "Program version: %{version}" | ||
version_not_found: "Version not found" |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pt: | ||
version: "Versão do programa: %{version}" | ||
version_not_found: "Versão desconhecida" |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
en: | ||
usage: | ||
description: "Usage: %{name} [-b <base_directory>] [-u <project_directory>] [-i <ignored_dependencies>] [-a] [-g] [-n <project_directory>] [-m <commit_message>]" | ||
line1: "-b <base_directory> Base directory where projects are located. (default: ~/Documents)" | ||
line2: "-u <project_directory> Updates the dependencies of the specified project directory." | ||
line3: " If multiple projects are provided, separate them with a comma." | ||
line4: "-i <ignored_dependencies> List of dependencies to be ignored, separated by a comma." | ||
line5: "-a Checks outdated dependencies in all projects." | ||
line6: "-g Checks the Git status in all projects." | ||
line7: "-n <project_directory> Runs npx npm-check-updates -u && npm install followed by a commit." | ||
line8: "-m <commit_message> Commit message to be used in updates. (optional)" | ||
line9: "-v, --version Shows the program version." | ||
interrupted: "\nScript execution interrupted." |
Oops, something went wrong.