forked from ndbroadbent/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added an awesome auto_reload PROMPT command that watches bashrc for c…
…hanges, and reloads automatically More reorganizing vims not needed any more Even more re-organizing Working on git config setup control rake task with env variable Moved ruby dotfiles into symlinked files made option OVERWRITE_ALL
- Loading branch information
1 parent
acc445b
commit b4d304c
Showing
93 changed files
with
139 additions
and
178 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
h3. Setup scripts and configuration for Ubuntu development machine | ||
|
||
* Base packages | ||
* Package installation | ||
* Git & SSH setup | ||
* Well-honed .bashrc | ||
* RVM & ruby 1.9.2 | ||
* gedit tweaked to perfection for Ruby on Rails | ||
* .bashrc with a lot of useful aliases / functions | ||
* RVM | ||
* Gnome themes, icons & conky | ||
|
||
h2. Run the following command to set up a freshly installed machine: | ||
h2. Run the following command to set up a new machine | ||
|
||
bc. sudo apt-get install -ym git-core && git clone https://github.com/ndbroadbent/ubuntu_config.git /tmp/ubuntu_config && cd /tmp/ubuntu_config && ./dev_machine_setup.sh | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
require 'rake' | ||
|
||
desc "Hook our dotfiles into system-standard positions." | ||
task :install do | ||
# Install symlinks | ||
linkables = Dir.glob('*/**{.symlink}') | ||
|
||
skip_all = false | ||
overwrite_all = ENV['OVERWRITE_ALL'] | ||
backup_all = false | ||
|
||
linkables.each do |linkable| | ||
overwrite = false | ||
backup = false | ||
|
||
file = linkable.split('/').last.split('.symlink').last | ||
target = "#{ENV["HOME"]}/.#{file}" | ||
|
||
if File.exists?(target) || File.symlink?(target) | ||
unless skip_all || overwrite_all || backup_all | ||
puts "File already exists: #{target}, what do you want to do? [s]kip, [S]kip all, [o]verwrite, [O]verwrite all, [b]ackup, [B]ackup all" | ||
case STDIN.gets.chomp | ||
when 'o' then overwrite = true | ||
when 'b' then backup = true | ||
when 'O' then overwrite_all = true | ||
when 'B' then backup_all = true | ||
when 'S' then skip_all = true | ||
when 's' then next | ||
end | ||
end | ||
FileUtils.rm_rf(target) if overwrite || overwrite_all | ||
`mv "$HOME/.#{file}" "$HOME/.#{file}.backup"` if backup || backup_all | ||
end | ||
`ln -s "$PWD/#{linkable}" "#{target}"` | ||
end | ||
|
||
# Run other install tasks | ||
%w(bashrc git_config).each do |script| | ||
puts "== Running setup/#{script}.sh" | ||
%x[./setup/#{script}.sh] | ||
end | ||
end | ||
|
||
task :uninstall do | ||
|
||
Dir.glob('**/*.symlink').each do |linkable| | ||
|
||
file = linkable.split('/').last.split('.symlink').last | ||
target = "#{ENV["HOME"]}/.#{file}" | ||
|
||
# Remove all symlinks created during installation | ||
if File.symlink?(target) | ||
FileUtils.rm(target) | ||
end | ||
|
||
# Replace any backups made during installation | ||
if File.exists?("#{ENV["HOME"]}/.#{file}.backup") | ||
`mv "$HOME/.#{file}.backup" "$HOME/.#{file}"` | ||
end | ||
|
||
end | ||
end | ||
|
||
task :default => 'install' |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Reloads bashrc if anything changes in a monitored directory | ||
auto_reload_bashrc() { | ||
local recent_change="$(bashrc_last_modified)" | ||
if [ "$BASHRC_LAST_UPDATED" != "$recent_change" ]; then | ||
export BASHRC_LAST_UPDATED="$recent_change" | ||
source $HOME/.bashrc | ||
fi | ||
} | ||
|
||
bashrc_last_modified() { | ||
find "$DOTFILES_PATH/bashrc" -type f -printf '%T@ %p\n' | sort -n | tail -1 | ||
} | ||
|
||
PROMPT_COMMAND="auto_reload_bashrc; $PROMPT_COMMAND" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,3 @@ restart_bamboo() { | |
ssh [email protected] "/etc/init.d/bamboo restart" | ||
echo "===== Restarted. Bamboo agents will automatically restart." | ||
} | ||
|
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
other_setup_scripts/iphone_bashrc_setup.sh → iphone/bashrc_setup.sh
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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Autotest.add_hook :initialize do |at| | ||
%w{.svn .hg .git vendor}.each {|exception| at.add_exception(exception)} | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require 'capistrano_colors' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
gem: --no-ri --no-rdoc |
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
set autoeval | ||
set autolist | ||
set autoreload |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export rvm_path="$HOME/.rvm" | ||
rvm_trust_rvmrcs_flag=1 |
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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
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
Oops, something went wrong.