-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·36 lines (28 loc) · 839 Bytes
/
Copy pathinstall.sh
File metadata and controls
executable file
·36 lines (28 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash -e
# Usage:
# ./install.sh <directory>
# Defaults to ~/bin
# Put the most recently compiled code in the current user's ~/bin directory
if [ "$1" == "" ]; then
INSTALL_DIR=/home/$USER/bin
else
INSTALL_DIR=$1
fi
if [[ $(objdump --syms ./build/seticore | grep debug_info) ]]; then
echo this is a debug build
exit 1
fi
BIN=./build/seticore
VERSION=`$BIN --help 2>&1 | grep version | sed 's:.* ::'`
INSTALLED_BIN=${INSTALL_DIR}/seticore
VERSIONED_BIN=${INSTALLED_BIN}-${VERSION}
if test -e "$VERSIONED_BIN"; then
echo $VERSIONED_BIN already exists - delete it or bump the version
exit 1
fi
echo installing seticore $VERSION
cp $BIN $VERSIONED_BIN
rm -f $INSTALLED_BIN
ln -s $VERSIONED_BIN $INSTALLED_BIN
VALIDATE=$($INSTALLED_BIN 2>&1 | grep version)
echo $VALIDATE now available at $INSTALLED_BIN