Last active
June 5, 2019 13:34
-
-
Save AndersDJohnson/5042332 to your computer and use it in GitHub Desktop.
installer for linux binaries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copies local files and directories to root path. | |
# Run this from the directory of the distr | |
_SRCDIR="./" | |
_SRCDIR_SED="\\./" | |
_INSTALLDIR="/" | |
_INSTALLDIR_SED="\/" | |
_DIRS=`find "$_SRCDIR" -type d` | |
# assumes an filename argument | |
function _install_prefix { | |
echo $1 | sed "s/^${_SRCDIR_SED}/${_INSTALLDIR_SED}/" | |
} | |
for _DIR in $_DIRS | |
do | |
mkdir -p "`_install_prefix $_DIR`" | |
done | |
_FILES=`find "$_SRCDIR" -type f` | |
for _FILE in $_FILES | |
do | |
cp "$_FILE" "`_install_prefix $_FILE`" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment