update_cadabra 1.1 → 1.2

Sign up to get free protection for your applications and to get access to all the features.
data/bin/update_cadabra CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env ruby
2
-
3
- exec "bash update_cadabra.sh"
2
+ puts "update cadabra starting ..."
3
+ exec "bash -l -c '#{File.dirname(File.dirname(__FILE__))}/bin/update_cadabra.sh'"
@@ -0,0 +1,73 @@
1
+ #!/bin/bash
2
+
3
+ # update cadabra!
4
+ # auto-update rvm( + rubygems & gems), rubygems (+ gems), macports (+ ports), homebrew formulas, textmate bundles -- pain-free!
5
+ # IMPORTANT: don't forget to run chmod u+x in this file before execute
6
+
7
+ if [ "$(whoami)" = 'root' ]; then
8
+ echo "Ooops! Don't run this script with sudo (some tools may need your enviroment variables to be correctly updated)"
9
+ exit 1
10
+ fi
11
+
12
+ sudo echo "" # just to get sudo access and don't bother you later :)
13
+
14
+ # find the dir of this script
15
+ SCRIPT_PATH="${BASH_SOURCE[0]}";
16
+ if([ -h "${SCRIPT_PATH}" ]) then
17
+ while([ -h "${SCRIPT_PATH}" ]) do SCRIPT_PATH=`readlink "${SCRIPT_PATH}"`; done
18
+ fi
19
+ pushd . > /dev/null
20
+
21
+ if which -s port
22
+ then
23
+ echo "==> update macports, ports, clean outdated ports and uninstall inactive ports"
24
+ sudo -E port -q selfupdate
25
+ sudo -E port -q -d sync > /dev/null
26
+ sudo -E port -u -q upgrade installed
27
+ #sudo -E port -f uninstall inactive (-u option in the previous line do this)
28
+ #sudo -E port clean --all installed - this isn't enough?
29
+ sudo -E port -f -p -q clean --all installed
30
+ rm -rf PortIndex PortIndex.quick
31
+ fi
32
+
33
+ if which -s brew
34
+ then
35
+ echo "==> update homebrew formulas"
36
+ brew update > /dev/null
37
+ fi
38
+
39
+ if which -s gem
40
+ then
41
+ echo "==> update rubygems and update the gems"
42
+ gem update -q --system > /dev/null
43
+ gem update -q > /dev/null
44
+ gem cleanup -q
45
+ fi
46
+
47
+ if which -s rvm
48
+ then
49
+ echo "==> update rvm, rubygems and update the gems"
50
+ rvm update > /dev/null
51
+ rvm reload > /dev/null
52
+ rvm gem update -q --system > /dev/null
53
+ rvm gem update -q > /dev/null
54
+ rvm gem cleanup -q
55
+ fi
56
+
57
+ if [ -d ~/Library/Application\ Support/TextMate/Bundles ]
58
+ then
59
+ echo "==> update textmate bundles"
60
+ cd ~/Library/Application\ Support/TextMate/Bundles
61
+ ls | while read bundle; do
62
+ if [ -d "${bundle}/.git" ]
63
+ then
64
+ echo " > ${bundle}"
65
+ cd "${bundle}"
66
+ # git doesnt allow me to do a git pull outside the dir (or the man page is a huge #fail)
67
+ git pull -q
68
+ cd ..
69
+ fi
70
+ done
71
+ fi
72
+
73
+ popd > /dev/null
metadata CHANGED
@@ -4,8 +4,8 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 1
7
- - 1
8
- version: "1.1"
7
+ - 2
8
+ version: "1.2"
9
9
  platform: ruby
10
10
  authors:
11
11
  - Diego Plentz
@@ -25,8 +25,8 @@ extensions: []
25
25
 
26
26
  extra_rdoc_files: []
27
27
 
28
- files: []
29
-
28
+ files:
29
+ - bin/update_cadabra.sh
30
30
  has_rdoc: true
31
31
  homepage: http://github.com/plentz/update_cadabra
32
32
  licenses: []