- what's
- snippets
- menu.sh : select from txt list and run a script
- create a eof encoded text file (.txt, .scss, .css, .html, .rb, .py...)
Last active
October 28, 2018 00:19
-
-
Save diogorusso/1a2d659d9e19cfd0fa39e49f8774ede3 to your computer and use it in GitHub Desktop.
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
echo "tchau tchau baby!!!" | |
exit 1 |
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
cat > ./example.txt <<- 'EOF' | |
--- | |
# file content | |
# file content | |
EOF | |
file -I ./example.txt | |
echo "encoding your file" ("us-ascii") to utf-8" | |
echo "π \033[1;34m Done!!! \033[0m" |
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
echo "π \033[1;34m ATTENTION: vamo remover o tema atual se existir algum!! \033[0m" | |
IFS=$'\r\n' GLOBIGNORE='*' command eval 'themes=($(cat ./_scripts/sh/_list-items.txt))' | |
IFS=$'\r\n' GLOBIGNORE='*' command eval 'themeActive=($(cat ./_scripts/sh/_item-active.txt))' | |
PS3=' π Please enter your choice: ' | |
select opt in "${themes[@]}" | |
do | |
echo "π \033[0m \033[1;34m $opt!!! \033[0m\033[1;32m Vamos instalar! \033[0m" | |
break | |
done | |
theme=$opt | |
export theme | |
# | |
rm ./_scripts/sh/_theme-active.txt | |
rm ./_theme/$themeActive/$themeActive.gemspec | |
rm ./_scripts/gulp/theme.js | |
rm -rf ./_config/ | |
rm Gemfile | |
rm Gemfile.lock | |
if [ $themeActive = "bootstrap" ] | |
then | |
rm ./.bootstraprc | |
rm ./_config/webpack.bootstrap.config.js | |
rm ./postcss.config.js | |
else | |
rm _config/postcss.config.js | |
fi | |
# | |
sh ./_scripts/sh/create_Config-_main.sh | |
echo "module.exports = {theme: '$opt'}" >> ./_scripts/gulp/theme.js | |
sh ./_scripts/sh/create_GemSpec.sh | |
sh ./_scripts/sh/create_Gemfile.sh | |
sh ./_scripts/sh/create_Hologram.sh | |
if [ "$opt" = "bootstrap" ] | |
then | |
sh ./_scripts/sh/create_BootstrapRC.sh | |
sh ./_scripts/sh/create_Webpack-Bootstrap.sh | |
sh ./_scripts/sh/create_Webpack-Dev-Bootstrap.sh | |
sh ./_scripts/sh/create_Webpack-Dist-Bootstrap.sh | |
echo "π \033[0m \033[1;34m boot!!! \033[0m\033[1;32m boot baby! \033[0m" | |
else | |
sh ./_scripts/sh/create_Webpack-Dev.sh | |
sh ./_scripts/sh/create_Webpack-Dist.sh | |
fi | |
sh ./_scripts/sh/create_Postcss.sh | |
bundle update | |
bundle install | |
echo "$opt" >> ./_scripts/sh/_item-active.txt |
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
html-react | |
bootstrap | |
bulma | |
foundation | |
mdl |
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
html-react |
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
# load files | |
IFS=$'\r\n' GLOBIGNORE='*' command eval 'themes=($(cat ./_scripts/sh/_items.txt))' | |
# new theme name | |
echo "π \033[1;34m qual o nome do seu novo tema? \033[0m" | |
read newTheme | |
echo "π \033[0m \033[1;34m $newTheme !!! \033[0m\033[1;32m vamo com tudo braΓ§o!! \033[0m" | |
theme=$newTheme | |
export theme | |
# select theme | |
echo "π \033[1;34m selecione um dos temas para clonar? \033[0m" | |
PS3='π Please enter your choice: ' | |
select opt in "${themes[@]}" | |
do | |
echo "π \033[0m \033[1;34m $opt!!! \033[0m\033[1;32m HEYYYY! \033[0m" | |
break | |
done | |
# copiar tema selecionado | |
cp -R ./_theme/$opt/ ./_theme/$newTheme | |
# remover .gemspec | |
rm ./_theme/$newTheme/*.gemspec | |
# criar novo .gemspec | |
sh ./_scripts/sh/create_GemSpec.sh | |
# atualizar array $themes | |
themes+=($newTheme) | |
echo "π \033[0m \033[1;34m ${themes[@]}!!! \033[0m\033[1;32m HEYYYY! \033[0m" | |
# deletar themes-custom.txt | |
rm ./_scripts/sh/_themes-custom.txt | |
# salvar $themes como themes-custom.txt | |
printf "%s\n" "${themes[@]}" > ./_scripts/sh/_list-items.txt | |
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
# load files | |
IFS=$'\r\n' GLOBIGNORE='*' command eval 'themes=($(cat ./_scripts/sh/_list-items.txt))' | |
if [ ${#themes[@]} -eq 0 ]; then | |
echo "No themes to delete, all clean!!!!" | |
break | |
else | |
# select theme to delete | |
echo "π \033[1;34m selecione um dos temas para DELETAR? \033[0m" | |
PS3='π Please enter your choice: ' | |
select opt in "${themes[@]}" | |
do | |
echo "π \033[0m \033[1;34m $opt!!! \033[0m\033[1;32m HEYYYY! \033[0m" | |
break | |
done | |
# remover tema from array | |
unset themes[$opt] | |
# deletar themes-custom.txt | |
rm ./_scripts/sh/_themes-custom.txt | |
# atualizar themes-custom.txt sem item | |
printf "%s\n" "${themes[@]}" > ./_scripts/sh/_list-items.txt | |
# remover aruqivos do tema | |
echo "Do you really wish to remove theme files?" | |
select yn in "Yes" "No"; do | |
case $yn in | |
Yes ) rm -rf ./_theme/$opt; break;; | |
No ) exit;; | |
esac | |
done | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment