Last active
February 27, 2024 18:41
-
-
Save elvitin/7ba0c4119c9a7b0372ceff11f4065fbb to your computer and use it in GitHub Desktop.
troca o tema do zsh
This file contains hidden or 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
#!/bin/bash | |
# Caminho do arquivo ~/.zshrc | |
zshrc_file="$HOME/.zshrc" | |
# Verifica se o arquivo existe | |
if [ ! -f "$zshrc_file" ]; then | |
echo "Erro: O arquivo ~/.zshrc não existe." | |
exit 1 | |
fi | |
# Verifica se o trecho ZSH_THEME="devcontainers" existe no arquivo | |
if ! grep -q 'ZSH_THEME="devcontainers"' "$zshrc_file"; then | |
echo "Erro: O trecho 'ZSH_THEME=\"devcontainers\"' não foi encontrado em ~/.zshrc" | |
exit 1 | |
fi | |
# Substitui 'devcontainers' por 'random' no arquivo ~/.zshrc | |
sed -i 's/ZSH_THEME="devcontainers"/ZSH_THEME="random"/' "$zshrc_file" | |
echo "Substituição concluída: 'devcontainers' foi substituído por 'random' em ~/.zshrc" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment