update_cadabra 1.0 → 1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/update_cadabra +2 -78
  2. metadata +2 -2
@@ -1,79 +1,3 @@
1
- #!/bin/bash
1
+ #!/usr/bin/env ruby
2
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 "update cadabra starting ... " # 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
- cd `dirname ${SCRIPT_PATH}` > /dev/null
21
- SCRIPT_PATH=`pwd`;
22
-
23
- #cd $SCRIPT_PATH
24
- #echo "==> trying to self-update :)"
25
- #git pull -q
26
-
27
- if which -s port
28
- then
29
- echo "==> update macports, ports, clean outdated ports and uninstall inactive ports"
30
- sudo -E port -q selfupdate
31
- sudo -E port -q -d sync > /dev/null
32
- sudo -E port -u -q upgrade installed
33
- #sudo -E port -f uninstall inactive (-u option in the previous line do this)
34
- #sudo -E port clean --all installed - this isn't enough?
35
- sudo -E port -f -p -q clean --all installed
36
- rm -rf PortIndex PortIndex.quick
37
- fi
38
-
39
- if which -s brew
40
- then
41
- echo "==> update homebrew formulas"
42
- brew update > /dev/null
43
- fi
44
-
45
- if which -s gem
46
- then
47
- echo "==> update rubygems and update the gems"
48
- gem update -q --system > /dev/null
49
- gem update -q > /dev/null
50
- gem cleanup -q
51
- fi
52
-
53
- if which -s rvm
54
- then
55
- echo "==> update rvm, rubygems and update the gems"
56
- rvm update > /dev/null
57
- rvm reload > /dev/null
58
- rvm gem update -q --system > /dev/null
59
- rvm gem update -q > /dev/null
60
- rvm gem cleanup -q
61
- fi
62
-
63
- if [ -d ~/Library/Application\ Support/TextMate/Bundles ]
64
- then
65
- echo "==> update textmate bundles"
66
- cd ~/Library/Application\ Support/TextMate/Bundles
67
- ls | while read bundle; do
68
- if [ -d "${bundle}/.git" ]
69
- then
70
- echo " > ${bundle}"
71
- cd "${bundle}"
72
- # git doesnt allow me to do a git pull outside the dir (or the man page is a huge #fail)
73
- git pull -q
74
- cd ..
75
- fi
76
- done
77
- fi
78
-
79
- popd > /dev/null
3
+ exec "bash update_cadabra.sh"
metadata CHANGED
@@ -4,8 +4,8 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 1
7
- - 0
8
- version: "1.0"
7
+ - 1
8
+ version: "1.1"
9
9
  platform: ruby
10
10
  authors:
11
11
  - Diego Plentz