Sha256: cf454fa3bc6c58efa33e62a461ee1aa06c29345fea01a0f2d18190cb7e442724

Contents?: true

Size: 856 Bytes

Versions: 24

Compression:

Stored size: 856 Bytes

Contents

#!/bin/bash

cd bin

if [[ "$1" =~ "y" ]]; then
  clobber=y
else
  read -p "Overwrite previous installation?  " clobber
fi

if [[ ! $clobber =~ y ]]; then
  echo Wont overwrite
  clobber=-n
else
  echo Will overwrite old files
  clobber=
fi

if [[ "$1" =~ "y" ]]; then
	var=
else
	read -p "Enter path besides /usr/bin to install (or leave blank) " var
fi

test -z || mkdir -p "$var"


sudo true || exit 1

tot=$(ls | wc -l)

for dest in /usr/bin $var; do
  num=0
  for exec in *; do
    if [[ -x "$exec" ]]; then
      ((num++))

      txt="$num/$tot"
      txtl=${#txt}
      last=${#tot}
      ((last = last * 2 + 1))
      for ((x = $txtl; x < $last; ++x)); do
        txt+=' '
      done
      txt+='...........'
      echo -n "$txt" | ./green
      sudo cp "$exec" "$dest" --verbose | ./green
    fi
  done
done

echo
echo DONE | green_bold_underline

Version data entries

24 entries across 24 versions & 6 rubygems

Version Path
ufos-1.0.94 ./install.sh
aliens-1.0.94 ./install.sh
freespeech-1.0.94 ./install.sh
elonmusk-1.0.94 ./install.sh
politics-1.0.94 ./install.sh
democracy-1.0.94 ./install.sh
democracy-1.0.93 ./install.sh
ufos-1.0.91 ./install.sh
aliens-1.0.91 ./install.sh
freespeech-1.0.91 ./install.sh
elonmusk-1.0.91 ./install.sh
politics-1.0.91 ./install.sh
politics-1.0.89 ./install.sh
ufos-1.0.87 ./install.sh
aliens-1.0.87 ./install.sh
freespeech-1.0.87 ./install.sh
elonmusk-1.0.87 ./install.sh
politics-1.0.87 ./install.sh
ufos-1.0.88 ./install.sh
aliens-1.0.88 ./install.sh