Compare commits
No commits in common. "d7c5624bd645340a690b0aab0b7d0e81a113a7ca" and "fb948873c6ce1a6b86323996aa11f25f14fe7a28" have entirely different histories.
d7c5624bd6
...
fb948873c6
59
install.sh
59
install.sh
@ -50,24 +50,13 @@ zsh_prompt() {
|
||||
get_files() {
|
||||
|
||||
# Create temp place where files will be stored
|
||||
cd src/importantinstalls
|
||||
> ../temp/importantinstalls.txt
|
||||
cd src/applications
|
||||
> ../temp/installations.txt
|
||||
|
||||
# File info
|
||||
applications=""
|
||||
counter=0
|
||||
|
||||
|
||||
for file in *; do
|
||||
# Every .sh file in application folder will be noted in installations.txt
|
||||
if [[ $file == *.sh ]]; then
|
||||
echo "${file%.*}" >> ../temp/importantinstalls.txt
|
||||
fi
|
||||
done
|
||||
|
||||
cd ../applications
|
||||
|
||||
# Write every file name into installations
|
||||
for file in *; do
|
||||
# Every .sh file in application folder will be noted in installations.txt
|
||||
@ -91,9 +80,6 @@ select_files() {
|
||||
printf %s "$YELLOW"
|
||||
# Show all the options
|
||||
echo "The following items will be installed."
|
||||
echo "-------------Must install-------------"
|
||||
cat importantinstalls.txt
|
||||
echo "--------------------------------------"
|
||||
cat installations.txt
|
||||
|
||||
printf %s "$RESET"
|
||||
@ -131,9 +117,6 @@ select_files() {
|
||||
|
||||
printf %s "$YELLOW"
|
||||
echo "The following items will be installed."
|
||||
echo "-------------Must install-------------"
|
||||
cat importantinstalls.txt
|
||||
echo "--------------------------------------"
|
||||
cat installations.txt
|
||||
echo
|
||||
printf %s "$RESET"
|
||||
@ -149,20 +132,6 @@ select_files() {
|
||||
install_files() {
|
||||
# Check if debug is activated
|
||||
if $debug; then
|
||||
|
||||
# Download important files
|
||||
while read line; do
|
||||
|
||||
#Reading each line and execute file
|
||||
if ! [ -x "$(command -v $line)" ]; then
|
||||
sh ../importantinstalls/$line.sh
|
||||
else
|
||||
echo "$line is already installed"
|
||||
fi
|
||||
|
||||
done < "importantinstalls.txt"
|
||||
|
||||
# Download the selected applications
|
||||
while read line; do
|
||||
|
||||
#Reading each line and execute file
|
||||
@ -179,7 +148,6 @@ install_files() {
|
||||
start=1
|
||||
end=100
|
||||
amount="$(wc -l < installations.txt)"
|
||||
amount=$(($amount + "$(wc -l < importantinstalls.txt)"))
|
||||
amount=$(($end / $amount))
|
||||
|
||||
# set design
|
||||
@ -187,33 +155,10 @@ install_files() {
|
||||
|
||||
printf %s "$YELLOW"
|
||||
echo "The following items are going to be installed:"
|
||||
cat importantinstalls.txt
|
||||
cat installations.txt
|
||||
echo ""
|
||||
printf %s "$RESET"
|
||||
|
||||
# download important files
|
||||
while read line; do
|
||||
printf %s "$YELLOW"
|
||||
|
||||
ProgressBar ${start} ${end} ${line}
|
||||
#Reading each line and execute file
|
||||
if ! [ -x "$(command -v $line)" ]; then
|
||||
sh ../importantinstalls/$line.sh >> /dev/null 2>&1
|
||||
fi
|
||||
|
||||
# update progressbar
|
||||
reach=$(( $start + $amount ))
|
||||
for number in $(seq ${start} ${reach}); do
|
||||
ProgressBar ${number} ${end} ${line}
|
||||
sleep 0.02
|
||||
done
|
||||
printf %s "$RESET"
|
||||
start=$reach
|
||||
|
||||
done < "importantinstalls.txt"
|
||||
|
||||
# download selected applications
|
||||
while read line; do
|
||||
printf %s "$YELLOW"
|
||||
|
||||
@ -237,9 +182,7 @@ install_files() {
|
||||
# Completing
|
||||
if [[ $start != 100 ]]; then
|
||||
for number in $(seq ${start} 100); do
|
||||
printf %s "$YELLOW"
|
||||
ProgressBar ${number} ${end} "..."
|
||||
printf %s "$RESET"
|
||||
sleep 0.02
|
||||
done
|
||||
fi
|
||||
|
@ -11,6 +11,6 @@ ProgressBar() {
|
||||
# program=$(printf "${_program}")
|
||||
|
||||
printf "\rProgress : |${fill// /▇}${empty// / }| ${_progress}%%"
|
||||
printf " Installing ${program} \r"
|
||||
printf " Installing ${program} \r"
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user