/useful/trunk-1

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/useful/trunk-1

« back to all changes in this revision

Viewing changes to install.sh

  • Committer: Gustav Hartvigsson
  • Date: 2024-09-30 19:03:54 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20240930190354-o57vi8aaqi0ezwz8
Misspelled:  pkcon.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env bash
2
 
 
3
 
##
 
2
####
 
3
# FILE NAME install.sh
 
4
#
4
5
# Install script for these scripts.
5
 
##
6
 
 
7
 
ARGS=()
8
 
ARGS="${@}"
 
6
#
 
7
####
9
8
 
10
9
 
11
10
__INSTALL_DIR=$HOME/bin
50
49
      ;;
51
50
      --target)
52
51
      __INSTALL_DIR="${2}"
53
 
      exit
 
52
      shift
54
53
      shift
55
54
      ;;
56
55
      *)
64
63
  done
65
64
}
66
65
 
 
66
####
 
67
# Utility function that prints what what is being executed.
 
68
# See: https://stackoverflow.com/a/23342259
 
69
####
 
70
function __exe () { echo "    $@" ; "$@" ; }
 
71
 
67
72
function __main () {
68
73
  if [[ $__INSTALL_SET == 1 ]]
69
74
  then
70
 
    mkdir -p $__INSTALL_DIR
71
 
    cp $__CWD/scripts/*.sh $__INSTALL_DIR/
 
75
    __exe mkdir -p $__INSTALL_DIR
 
76
    for __file__ in $__CWD/scripts/*.sh
 
77
    do
 
78
      __exe cp $__file__ $__INSTALL_DIR/
 
79
    done
72
80
  else
73
81
    echo ""
74
82
    echo "YOU MUST PROVIE -i OR --install FOR IT TO INSTALL THE SCRIPTS."