💾 Archived View for hajime.4teri.de › dotfiles › file › scripts › programs.sh.gmi captured on 2021-12-04 at 18:04:22. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-12-03)

-=-=-=-=-=-=-

programs.sh - dotfiles - Collection of my dotfiles

Log

Files

Refs

---

programs.sh (510B)

---

1 #! /bin/sh

2 PROG_DIR="/home/zocki/programs"

3 ENTER="\033[34;48m"

4 LEAVE="\033[33;48m"

5 ERROR="\033[31;48m"

6 END="\033[0m"

7

8 die()

9 {

10 echo "Could not enter a directory!"

11 exit

12 }

13

14 git_pull()

15 {

16 if [ -e .git ]

17 then

18 echo "$(git remote get-url origin)"

19 git pull

20 else

21 echo -e "$ERROR $(pwd) is not a git repo. $END"

22 fi

23 }

24

25 curr_dir=$(pwd)

26 cd "$PROG_DIR" || die

27

28 for dir in *

29 do

30 cd "$dir" || die

31 echo -e "$ENTER Entering $dir $END"

32 git_pull

33 echo -e "$LEAVE Leaving $dir $END"

34 cd ..

35 done

36

37 cd "$curr_dir" || die

generated w/ stagit-gemini