forked from vanderhoop/installfest_script
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathubuntu
More file actions
759 lines (550 loc) · 20.4 KB
/
ubuntu
File metadata and controls
759 lines (550 loc) · 20.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
#!/usr/bin/env bash
#
# _ _ _ _ __ _
# (_)_ __ ___| |_ __ _| | |/ _| ___ ___| |_
# | | '_ \/ __| __/ _` | | | |_ / _ \/ __| __|
# | | | | \__ \ || (_| | | | _| __/\__ \ |_
# |_|_| |_|___/\__\__,_|_|_|_| \___||___/\__|
#
# Installation, Setup and Dotfile Creation Script
# for Students of General Assemb.ly's WDI Program
# Author: Phillip Lamplugh, GA Instructor (2014)
# Contributions: PJ Hughes, GA Instructor (2014)
# Resources:
#
# https://github.com/thoughtbot/laptop
# https://github.com/toranb/ubuntu-development-machine
# https://github.com/divio/osx-bootstrap
# https://github.com/paulirish/dotfiles
# https://github.com/mathiasbynens/dotfiles/
# https://github.com/ndbroadbent/dotfiles
# References:
#
# http://www.sudo.ws/
# http://www.gnu.org/software/bash/manual/bashref.html
# http://www.shellcheck.net
# http://explainshell.com/
#-------------------------------------------------------------------------------
# Handle Command Line Options
#-------------------------------------------------------------------------------
while getopts "vf" FLAG; do
case $FLAG in
f ) FORCE=true;;
v ) VERBOSE=true;;
? ) exit 2;;
esac
done
#-------------------------------------------------------------------------------
# Logging
#-------------------------------------------------------------------------------
# set up logfile
LOGFOLDER="$HOME/.wdi"; mkdir -p $LOGFOLDER
LOGFILE="$LOGFOLDER/install.log"
# if we are logging verbosely
# echo_log() & assert_that() -> stderr -> stdout -> *logfile* -> console
# else we are only logging assertions ([- n "$verbose" ] == false)
# echo_log() & assert_that() -> stderr -> *logfile* -> stdout -> console
# this is done by:
# a. directing echo_log() & assert_that() to stderr, via
# {echo "" >&2}, and ...
echo_log() {
echo "$1\n" >&2
}
if [ -n "$VERBOSE" ]; then
# b. executing the script so that stdout 'tee's to logfile, via
# {exec 1> >(tee logfile)} | {exec > >(tee logfile)}
# c. executing the script so that stderr redirects to stdout, via
# {exec 2>&1}
exec > >(tee $LOGFILE); exec 2>&1
else
# b. executing the script so that stderr 'tee's to logfile, via
# {exec 2> >(tee logfile)}
exec 2> >(tee $LOGFILE)
fi
echo_log
echo_log "Script execution begun: $(date)"
if [ -n "$FORCE" ]; then
echo_log " Force option set to true: will continue script despite failed assertions."
else
echo_log " Script will exit on failed assertions. Use -f option to force completion."
fi
if [ -n "$VERBOSE" ]; then
echo_log " Verbose logging option set to true: will log all output, not just errors, log statements and assertions."
else
echo_log " Script will log errors, log statements and assertions only. Use -v option to log verbosely."
fi
echo_log
#-------------------------------------------------------------------------------
# Set text formatting
#-------------------------------------------------------------------------------
# set 256 color profile where possible
if [[ $COLORTERM == gnome-* && $TERM == xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
export TERM=gnome-256color
elif infocmp xterm-256color >/dev/null 2>&1; then
export TERM=xterm-256color
fi
# Reset formatting
RESET=$( tput sgr0)
# Foreground color
BLACK=$( tput setaf 0)
RED=$( tput setaf 1)
GREEN=$( tput setaf 2)
YELLOW=$( tput setaf 3)
BLUE=$( tput setaf 4)
MAGENTA=$( tput setaf 5)
CYAN=$( tput setaf 6)
WHITE=$( tput setaf 9)
# Background color
BG_BLACK=$( tput setab 0)
BG_RED=$( tput setab 1)
BG_GREEN=$( tput setab 2)
BG_YELLOW=$( tput setab 3)
BG_BLUE=$( tput setab 4)
BG_MAGENTA=$( tput setab 5)
BG_CYAN=$( tput setab 6)
BG_WHITE=$( tput setab 9)
# Style
UNDERLINE=$( tput smul)
NOUNDERLINE=$(tput rmul)
BOLD=$( tput bold)
ITALIC=$( tput sitm)
function quoth_the_bard () {
local message=$1
local attribution=$2
echo ""
echo "${RED}${message}${RESET}"
echo "${BLUE}${attribution}${RESET}"
echo ""
}
function pause_awhile () {
read -p "We will now $*. Press ${BOLD}Enter${RESET} to continue."
}
THE_PLAYS_THE_THING="The play's the thing..."
HOW_NOW_SSH_KEYS=(
"Double, double toil and trouble; Fire burn, and caldron bubble."
"--Macbeth (IV.i)"
)
HOW_NOW_RVM=(
"Woe, destruction, ruin, and decay; the worst is death and death will have his day."
"--Richard II (III.ii)"
)
HOW_NOW_BREW=(
"PISTOL: The plain-song is most just: for humours do abound:
Knocks go and come; God's vassals drop and die;
And sword and shield,
In bloody field,
Doth win immortal fame.
Boy: Would I were in an alehouse in London! I would give
all my fame for a pot of ale and safety."
"--Henry V (III.ii)"
)
HOW_NOW_TERMINAL=(
"I have touch'd the highest point of all my greatness;
And, from that full meridian of my glory,
I haste now to my setting: I shall fall
Like a bright exhalation in the evening,
And no man see me more."
"--Henry VIII (III.ii)"
)
HOW_NOW_RUBY=(
"Once more the ruby-colour'd portal open'd,"
"--Venus and Adonis (1593)"
)
HOW_NOW_GIT=(
"MARIA: This and these pearls to me sent Longaville:
The letter is too long by half a mile.
PRINCESS OF FRANCE: I think no less. Dost thou not wish in heart
The chain were longer and the letter short?"
"--Love's Labour Lost (V.ii)"
)
HOW_NOW_APPS=(
"Lend me an arm; the rest have worn me out
With several applications..."
"--All's Well That Ends Well (I.ii)"
)
HOW_NOW_CONFIGURE=(
"Suit the action to the word, the word to the action,
with this special observance that you o'erstep not the modesty of nature."
"--Hamlet (III.ii)"
)
HOW_NOW_GEMS=(
"Making a couplement of proud compare,
With sun and moon, with earth and sea's rich gems,
With April's first-born flowers, and all things rare
That heaven's air in this huge rondure hems."
"--Sonnet 21"
)
HOW_NOW_DB=(
"'Tis in my memory lock'd, And you yourself shall keep the key of it."
"--Hamlet (I.iii)"
)
HOW_NOW_FINISH=(
"Once more unto the breach, dear friends, once more;
Or close the wall up with our English dead."
"--Henry V (III.i)"
)
HOW_NOW_NODE=(
"But that my heart's on future mischief set,
I would speak blasphemy ere bid you fly:
But fly you must; uncurable discomfit
Reigns in the hearts of all our present parts."
"--Henry VI, Part 2 (V.ii)"
)
HOW_NOW_GIT=(
"HAMLET: ... for you yourself, sir,
should be old as I am if, like a crab, you could go backward.
POLONIUS: [aside] Though this be madness, yet there is a method in't.-
Will You walk out of the air, my lord?"
"--Hamlet (II.ii)"
)
clear
echo "Welcome to Installfest
Throughout the script you will be asked to enter your password. Unless otherwise
stated, this is asking for your computer's password.
This will install or update files and applications that you will use in class."
echo ""
pause_awhile "begin"
echo "${GREEN}The play's the thing...${GREEN}"
quoth_the_bard "${HOW_NOW_TERMINAL[@]}"
pause_awhile "define environmental variables for the install"
# set FORCE (do not quit on error) to true if it is not loaded, as a default
: ${FORCE=true} # TODO (h4w5) since we are testing for null, this will always happen
# switch to true/false
# use an empty function for assertions...
assert_that() {
echo "" > /dev/null
}
# use an empty function for assertions...
assert_package_installed() {
echo "" > /dev/null
}
BELOVED_RUBY_VERSION="2.1.2"
CURRENT_STABLE_RUBY_VERSION="2.1.2"
# TODO (phlco) set this in env vars or create_student_folders?
# STUDENT_FOLDER_SETUP="$HOME/src/wdi"
# TODO backport this into master and mac...
SRC_DIR=~/.wdi/installfest
SETTINGS=$SRC_DIR/settings
INSTALL_REPO=https://github.com/amadden80/installfest_script.git
# Standard Bash Variables
# `OSTYPE` A string describing the operating system Bash is running on.
# `MACHTYPE` system type in cpu-company-system
# `SECONDS` number of seconds since the shell was started.
# This refers to the branch of our repo that we are using (for cloning).
BRANCH=master
# capture the user's password
sudo -p "Enter your computer's password so that we can make the necessary changes: " echo "Thank you."
pause_awhile "update your OS with necessary tools"
#-------------------------------------------------------------------------------
# Check for software updates
#-------------------------------------------------------------------------------
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
packagelist=(
# Autoconf is an extensible package of M4 macros that produce shell scripts
# to automatically configure software source code packages.
autoconf
# Automake is a tool for automatically generating Makefile.in
automake
# general-purpose parser generator that converts an annotated context-free
# grammar into an LALR or GLR parser for that grammar.
bison
# generic library support script
libtool
# a YAML 1.1 parser and emitter
libyaml-dev
# provides a set of functions for use by applications that allow users to
# edit command lines as they are typed in
libreadline6
libreadline6-dev
libreadline-dev
# XML C parser and toolkit
libxml2-dev
# a language for transforming XML documents into other XML documents.
libxslt1-dev
# gnome-keyring is a daemon in the session, similar to ssh-agent,
# and other applications can use it to store passwords and other
# sensitive information
# atom dependency?
libgnome-keyring-dev
# OpenSSL implementation of SSL
libssl-dev
libcurl4-openssl-dev
# version control
git
git-core
# copy to clipboard
xclip
# command line tool for transferring data with URL syntax
curl
# This software provides an abstraction of the used apt repositories.
python-software-properties
# a reference for all the packages needed to compile a debian package
# generally includes the gcc/g++ compilers an libraries and some other utils
build-essential
# library implementing the deflate compression method found in gzip and PKZIP
zlib1g-dev
# generates an index file of names found in source files of various
# programming languages.
exuberant-ctags
# Header files and static library for compiling C programs to link with the
# libpq library in order to communicate with a PostgreSQL database backend.
libpq-dev
# or try
# gem install pg -- --with-pg-lib=/usr/lib
# self-contained, serverless, transactional SQL database engine.
sqlite3
libsqlite3-dev
# ASCII ART!!!!
figlet
# visualization tool for ERDs
graphviz
# image resizing
imagemagick
# headless WebKit scriptable with a JavaScript API.
phantomjs
)
sudo apt-get -y install ${packagelist[@]}
assert_package_installed ${packagelist[@]}
quoth_the_bard "${HOW_NOW_GIT[@]}"
pause_awhile "add GitHub credentials to our keychain"
echo "Please register for an account on github.com if you haven't already done so."
read -p "Enter your full name: " user_name
read -p "Github Username: " github_name
read -p "Github Email: " github_email
read -s -p "Github Password: " github_password
quoth_the_bard "${HOW_NOW_SSH_KEYS[@]}"
# SSH keys establish a secure connection between your computer and GitHub
# This script follows these instructions
# `https://help.github.com/articles/generating-ssh-keys`
# SSH Keygen
ssh-keygen -t rsa -C $github_email
ssh-add id_rsa
public_key=$(cat ~/.ssh/id_rsa.pub)
# Upload to github
curl https://api.github.com/user/keys \
-H "User-Agent: WDIInstallFest" \
-H "Accept: application/vnd.github.v3+json" \
-u "$github_name:$github_password" \
-d '{"title":"WDI Installfest", "key":"'"$public_key"'"}'
# TODO (h4w5) add assertion around ... "ssh -T [email protected]"
# Add user's github info to gitconfig
# https://www.kernel.org/pub/software/scm/git/docs/git-config.html
git config --global user.name $github_name
git config --global user.email $github_email
# set colors
git config --global color.ui always
git config --global color.branch.current "green reverse"
git config --global color.branch.local green
git config --global color.branch.remote yellow
git config --global color.status.added green
git config --global color.status.changed yellow
git config --global color.status.untracked red
# set editor
git config --global core.editor "subl -w"
# default branch to push to
git config --global push.default current
# download the repo for the absolute paths
if [[ ! -d $SRC_DIR ]]; then
echo 'Downloading Installfest repo...'
# autoupdate bootstrap file
git clone -b $BRANCH $INSTALL_REPO $SRC_DIR
# hide folder
# chflags hidden $SRC_DIR # FIXME (h4w5) doesn't work on linux
else
# update repo
echo 'Updating repo...'
cd $SRC_DIR
git pull origin $BRANCH
fi
# Heroku command-line tooling for working with the Heroku platform
# http://eoinoc.net/install-hub-github-linux-mint/
# wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
# from the above, but using our current environment:
# add heroku repository to apt
sudo sh -c 'echo "deb http://toolbelt.heroku.com/ubuntu ./" > /etc/apt/sources.list.d/heroku.list'
# install heroku's release key for package verification
wget -O- https://toolbelt.heroku.com/apt/release.key | sudo apt-key add -
# update your sources with heroku packages
sudo apt-get update -y
# install the toolbelt
sudo apt-get install -y heroku-toolbelt
# https://devcenter.heroku.com/articles/keys
# FIXME [email protected]: not working as it is -- can't find `heroku`
# echo "Heroku is a cloud platform as a service (PaaS) supporting several"
# echo "programming languages."
# echo "If you don’t already use SSH, you’ll need to create a public/private key"
# echo "pair to deploy code to Heroku. This keypair is used for the strong"
# echo "cryptography and that uniquely identifies you as a developer when pushing"
# echo "code changes."
# ssh-keygen -t rsa
# echo "The first time you run the heroku command, you’ll be prompted for your "
# echo "credentials. Your public key will then be automatically uploaded to"
# echo "Heroku. This will allow you to deploy code to all of your apps."
# echo "Please enter your email"
# heroku keys:add
# run this before or after long chunks of the script to update the sudo timestamp
sudo -nv
quoth_the_bard "${HOW_NOW_GEMS[@]}"
pause_awhile "install rbenv and Gem list"
# uninstall rvm, so that we can use rbenv
# http://stackoverflow.com/questions/3950260/howto-uninstall-rvm
if hash rvm 2>/dev/null || [ -d ~/.rvm ]; then
yes | rvm implode
rm -rf ~/.rvm
fi
assert_that "RVM has been removed or was not installed" "command -v rvm" ""
# Our ruby version manager
# rbenv
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
assert_that "Rbenv is installed" "rbenv version"
# Specify default gems in ~/.rbenv/default-gems
git clone https://github.com/sstephenson/rbenv-default-gems.git ~/.rbenv/plugins/rbenv-default-gems
# automatically runs rbenv rehash every time you install or uninstall a gem
git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
# Provides an rbenv install command to compile and install different versions of Ruby
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
assert_that "Rbenv's ruby-build plugin is installed" "rbenv install"
# Our gems to install
# skip documentation
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
# TODO (phlco) replace ~/.rbenv with $RBENV_ROOT
touch ~/.rbenv/default-gems
gemlist=(
bundler # Maintains a consistent environment for ruby applications.
capybara # Acceptance test framework for web applications
guard # handle events on file system modifications
jasmine # JavaScript testing
pry # alternative to the standard IRB shell
pry-coolline # live syntax highlighting for the Pry REPL
rails # full stack, Web application framework
rspec # testing tool for Ruby
sinatra # a DSL for quickly creating web applications in Ruby
sinatra-contrib # common Sinatra extensions
github_api # Ruby interface to github API v3
hipchat # HipChat HTTP API Wrapper
awesome_print # pretty print your Ruby objects with style
rainbow # colorizing printed text on ANSI terminals
)
for gem in ${gemlist[@]}; do
echo "${gem}" >> ~/.rbenv/default-gems
done
# For testing and simplicity with Ubuntu, add these to the .bashrc until it's
# overwritten...
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
quoth_the_bard "${HOW_NOW_RUBY[@]}"
pause_awhile "install Ruby with rbenv"
ruby_check=$(rbenv versions | grep $BELOVED_RUBY_VERSION)
if [[ "$ruby_check" == *$BELOVED_RUBY_VERSION* ]]; then
echo "$BELOVED_RUBY_VERSION is installed"
else
rbenv install $BELOVED_RUBY_VERSION
fi
assert_that "Ruby is installed and links to rbenv" "which ruby" "$HOME/.rbenv/shims/ruby"
rbenv global $BELOVED_RUBY_VERSION
assert_that "Ruby version is now '${BELOVED_RUBY_VERSION}'" \
"ruby -v | grep -q ${BELOVED_RUBY_VERSION} && echo 'true'" "true"
# check for gems
for gem in ${gemlist[@]}; do
assert_that "$gem gem is installed" "gem list $gem -i" "true"
done
# run this before or after long chunks of the script to update the sudo timestamp
sudo -nv
quoth_the_bard "${HOW_NOW_NODE[@]}"
pause_awhile "install Node and npm"
# Event-driven I/O server-side JavaScript environment based on V8
sudo apt-get -y install nodejs
# Node package manager
sudo apt-get -y install npm
# For programs that still depend on calling the "node" binary, run:
sudo apt-get -y install nodejs-legacy
quoth_the_bard "${HOW_NOW_APPS[@]}"
pause_awhile "install classroom applications"
# Google Chrome.........The Browser
# HipChat...............The Chat Client
# Sublime Text 2........The Text Editor
# chrome
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo apt-get -y update
sudo apt-get -y install google-chrome-stable
# hipchat
sudo sh -c 'echo "deb http://downloads.hipchat.com/linux/apt stable main" > /etc/apt/sources.list.d/atlassian-hipchat.list'
wget -O - https://www.hipchat.com/keys/hipchat-linux.key | sudo apt-key add -
sudo apt-get -y update
sudo apt-get -y install hipchat
# sublime
sudo add-apt-repository -y ppa:webupd8team/sublime-text-2
sudo apt-get -y update
sudo apt-get -y install sublime-text
# zsh
sudo apt-get -y install zsh
# flux
sudo add-apt-repository -y ppa:kilian/f.lux
sudo apt-get -y update
sudo apt-get -y install fluxgui
# hub
git clone https://github.com/github/hub.git
cd hub
# TODO (phlco) permission problems... sudo chown -R `whoami` /usr/local/* ?
rake install prefix=/usr/local
# vim
sudo apt-get -y install vim
# emacs
sudo apt-get -y install emacs
quoth_the_bard "${HOW_NOW_DB[@]}"
pause_awhile "install PostgreSQL"
# open source object-relational database management system
# https://www.digitalocean.com/community/articles/how-to-install-and-use-postgresql-on-ubuntu-12-04
# TODO phlco set up user
# https://help.ubuntu.com/community/PostgreSQL
# sudo apt-get -y install postgresql-xc-client
# sudo apt-get -y install postgresql-client
# sudo apt-get -y install postgresql
# sudo apt-get -y install postgresql-contrib
# sudo apt-get -y install pg_ctl # initialize stop/start posgres
sudo apt-get -y install postgresql
sudo apt-get -y install postgresql-contrib
sudo apt-get -y install libpq-dev # should fix issue with installing pg gem
sudo -u postgres createuser --superuser $USER
# TODO phlco. taking out?
# sudo -u postgres psql
# create a history?
touch ~/.psql_history
createdb $USER
# Install ruby interface for Postgres
gem install pg
quoth_the_bard "${HOW_NOW_CONFIGURE[@]}"
pause_awhile "do final configurations"
echo "Creating directory for wdi: ~/src/wdi"
echo "Creating directory for hacking and new work: ~/src/workbench"
echo "Creating directory for 3rd party code: ~/src/vendor"
echo "Creating directory for projects: ~/src/projects"
STUDENT_FOLDER="$HOME/src/wdi"
mkdir -p $STUDENT_FOLDER
mkdir "$HOME/src/workbench"
mkdir "$HOME/src/vendor"
mkdir "$HOME/src/projects"
SRC_DIR=~/.wdi/installfest
SETTINGS=$SRC_DIR/settings
dotfiles=($SETTINGS/*)
timestamp=$(date +%s)
mkdir -p $HOME/.wdi/backups_$timestamp
for filepath in "${dotfiles[@]}"; do
dotfile=".$(basename $filepath)"
if [[ -a "$HOME/$dotfile" ]]; then
cp "$HOME/$dotfile" "$HOME/.wdi/backups_$timestamp/$dotfile"
fi
cp $filepath "$HOME/$dotfile"
done
# Don't ask questions
export DEBIAN_FRONTEND=noninteractive
sudo apt-get install -y mailutils
quoth_the_bard "${HOW_NOW_FINISH[@]}"
echo "We're done!"
echo "#-- fin -- #"