Permalink
Browse files

Create package_manager_update

Idea (and most of the code) stolen from https://github.com/cmer/shoestrap/blob/master/helpers/default.
  • Loading branch information...
booch committed Mar 7, 2013
1 parent f525962 commit 6159b6eb72dd5ff95e524b387136dc22bbd163d0
Showing with 17 additions and 0 deletions.
  1. +17 −0 sbin/package_manager_update
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+# Updates the package manager with the latest list of packages.
+
+
+PACKAGE_MANAGER=$(package_maneger_name)
+
+if [ "$PACKAGE_MANAGER" == 'apt-get' ]; then
+ apt-get update -y
+elif [ "$PACKAGE_MANAGER" == 'yum' ]; then
+ yum check-update -y
+elif [ "$PACKAGE_MANAGER" == 'brew' ]; then
+ brew update
+else
+ echo "Unknown package manager: $PACKAGE_MANAGER"
+ exit 1
+fi

0 comments on commit 6159b6e

Please sign in to comment.