Skip to content

Instantly share code, notes, and snippets.

@andrewwoods
Created January 16, 2020 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewwoods/bbb4eacf3d56a85be90c70f03f24221e to your computer and use it in GitHub Desktop.
Save andrewwoods/bbb4eacf3d56a85be90c70f03f24221e to your computer and use it in GitHub Desktop.
Bash function to setup new user account files
#
# Whenever you get a new computer, you need to create some files and
# directories to get things configured. No need to load this in your .bashrc
# file. Just source this when you need it. Call it like this:
#
# $ source new-account-setup.bash
# $ cd ~ && new_account_setup
#
function new_account_setup {
# Create Bash directory structure
mkdir -p bash/{aliases,data,functions}
touch bash/bashrc
touch bash/profile
touch bash/arrays.bash
# Create Git directory structure
mkdir -p git
touch git/{config,ignore}
# Create Vim directory structure
mkdir -p vim/{functions,themes,templates}
# Create dev directory structure
mkdir -p bin config docs etc lib
# Create business directory structure
mkdir -p projects photos resources
# Load library files in main files
echo "source bash/arrays.bash" >> .bashrc
echo "source bash/bashrc" >> .bashrc
echo "source bash/profile" >> .bash_profile
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment