mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: Add more parameters support to install.sh
This commit is contained in:
parent
6cc2ff377a
commit
2ab952bc3a
1 changed files with 37 additions and 5 deletions
|
|
@ -1,9 +1,41 @@
|
|||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
if [ -z $1 ]
|
||||
then DC_INSTALL_DIR=$DC_INSTALL_PREFIX/opt/doublecmd
|
||||
else DC_INSTALL_DIR=$1/doublecmd
|
||||
fi
|
||||
function help()
|
||||
{
|
||||
echo
|
||||
echo 'Usage: install.sh [options]'
|
||||
echo
|
||||
echo 'Options:'
|
||||
echo '-P, --portable-prefix Path prefix for portable package'
|
||||
echo '-I, --install-prefix Path prefix for installable package'
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Parse input parameters
|
||||
CKNAME=$(basename "$0")
|
||||
args=$(getopt -n $CKNAME -o P:,I: -l portable-prefix:,install-prefix:,default -- "$@")
|
||||
eval set -- $args
|
||||
for A
|
||||
do
|
||||
case "$A" in
|
||||
--)
|
||||
help
|
||||
;;
|
||||
-P|--portable-prefix)
|
||||
shift
|
||||
DC_INSTALL_DIR=$(eval echo $1/doublecmd)
|
||||
break
|
||||
;;
|
||||
-I|--install-prefix)
|
||||
shift
|
||||
DC_INSTALL_PREFIX=$(eval echo $1)
|
||||
DC_INSTALL_DIR=$DC_INSTALL_PREFIX/opt/doublecmd
|
||||
break
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
mkdir -p $DC_INSTALL_DIR
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue