/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: 2021-01-13 20:18:48 UTC
  • Revision ID: git-v1:df5c8db5509b9612b896bd2a9fc8b50ee5eedb1e
You can use git on Launchpad too.

Show diffs side-by-side

added added

removed removed

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