Skip to content

Instantly share code, notes, and snippets.

@jeansordes
Created October 21, 2024 17:12
Show Gist options
  • Save jeansordes/289446cd8eb762ed5e93a4473b268dc3 to your computer and use it in GitHub Desktop.
Save jeansordes/289446cd8eb762ed5e93a4473b268dc3 to your computer and use it in GitHub Desktop.
Script to install the Betty Linter (from Holberton School)
#!/bin/bash
##########################################
##########################################
# Configuration globale du profile GITHUB
# git config --global user.name "YOUR_GITHUB_USERNAME"
# git config --global user.email "YOUR_GITHUB_EMAIL"
# Exemple de clonage d'une repo GITHUB avec le TOKEN dans le URL pour éviter la saisie des coordonnées à chaque git push
# Replacer YOUR_GITHUB_USERNAME, YOUR_PERSONAL_ACCESS_TOKEN, et REPO_URL avec vos vraies informations.
# Format: https://YOUR_GITHUB_USERNAME:YOUR_PERSONAL_ACCESS_TOKEN@REPO_URL
# EXAMPLE:
# git clone https://YOUR_GITHUB_USERNAME:[email protected]/OWNER/REPOSITORY.git
##########################################
##########################################
# Configuration de Betty
cd $HOME
git clone https://github.com/hs-hq/Betty.git
cd Betty
./install.sh
touch betty
cat > betty << 'EOF'
#!/bin/bash
# Simply a wrapper script to keep you from having to use betty-style
# and betty-doc separately on every item.
# Originally by Tim Britton (@wintermanc3r), multiargument added by
# Larry Madeo (@hillmonkey)
BIN_PATH="/usr/local/bin"
BETTY_STYLE="betty-style"
BETTY_DOC="betty-doc"
if [ "$#" = "0" ]; then
echo "No arguments passed."
exit 1
fi
for argument in "$@" ; do
echo -e "\n========== $argument =========="
${BIN_PATH}/${BETTY_STYLE} "$argument"
${BIN_PATH}/${BETTY_DOC} "$argument"
done
EOF
chmod a+x betty
mv betty /bin/
##########################################
##########################################
# Configuration de EMACS
cd $HOME
touch .emacs
cat > .emacs << 'EOF'
(setq c-default-style "bsd"
c-basic-offset 8
tab-width 8
indent-tabs-mode t)
(require 'whitespace)
(setq whitespace-style '(face empty lines-tail trailing))
(global-whitespace-mode t)
(setq column-number-mode t)
EOF
##########################################
##########################################
# Configuration de VIM
cd $HOME
touch .vimrc
cat > .vimrc << 'EOF'
set tabstop=8 shiftwidth=8
set autoindent
set smartindent
set cindent
syntax enable
set number
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment