mirror of
https://github.com/Matir/skel.git
synced 2026-06-09 19:03:41 -07:00
Update install_tool script.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
set -ue
|
||||
|
||||
REINSTALL=0
|
||||
PACKAGES=1
|
||||
|
||||
while getopts -- "-:" a ; do
|
||||
case "${a}" in
|
||||
@@ -11,6 +12,9 @@ while getopts -- "-:" a ; do
|
||||
reinstall)
|
||||
REINSTALL=1
|
||||
;;
|
||||
no-packages)
|
||||
PACKAGES=0
|
||||
;;
|
||||
*)
|
||||
echo "Unknown long option ${OPTARG}" >/dev/stderr
|
||||
exit 1
|
||||
@@ -20,7 +24,6 @@ while getopts -- "-:" a ; do
|
||||
done
|
||||
|
||||
shift $(($OPTIND-1))
|
||||
echo $*
|
||||
|
||||
if [ $# -ne 1 ] ; then
|
||||
echo "Usage: ${0} <tool>" >/dev/stderr
|
||||
@@ -29,9 +32,13 @@ fi
|
||||
TOOL=${1}
|
||||
|
||||
function install_pkgs {
|
||||
if [ ${PACKAGES} -eq 0 ] ; then
|
||||
return 0
|
||||
fi
|
||||
if [ `id -u` -ne "0" ] ; then
|
||||
sudo apt-get -y install $* || (
|
||||
echo "Unable to install packages, please ensure these are installed." >/dev/stderr
|
||||
echo -n "Unable to install packages, please ensure these " >/dev/stderr
|
||||
echo "are installed, then run with --no-packages." >/dev/stderr
|
||||
echo $*
|
||||
false )
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user