Simpler merge process
This commit is contained in:
parent
465a3b9b80
commit
4f76bb4ad2
21
dev/merge.sh
21
dev/merge.sh
|
@ -5,6 +5,9 @@
|
||||||
## Merges ofunctions.sh and n_program.sh into program.sh
|
## Merges ofunctions.sh and n_program.sh into program.sh
|
||||||
## Adds installer
|
## Adds installer
|
||||||
|
|
||||||
|
PROGRAM=merge
|
||||||
|
INSTANCE_ID=dev
|
||||||
|
|
||||||
function Usage {
|
function Usage {
|
||||||
echo "Merges ofunctions.sh and n_program.sh into debug_program.sh and ../program.sh"
|
echo "Merges ofunctions.sh and n_program.sh into debug_program.sh and ../program.sh"
|
||||||
echo "Usage"
|
echo "Usage"
|
||||||
|
@ -46,6 +49,7 @@ function __PREPROCESSOR_Constants {
|
||||||
__PREPROCESSOR_SUBSETS=(
|
__PREPROCESSOR_SUBSETS=(
|
||||||
'#### OFUNCTIONS FULL SUBSET ####'
|
'#### OFUNCTIONS FULL SUBSET ####'
|
||||||
'#### OFUNCTIONS MINI SUBSET ####'
|
'#### OFUNCTIONS MINI SUBSET ####'
|
||||||
|
'#### OFUNCTIONS MICRO SUBSET ####'
|
||||||
'#### PoorMansRandomGenerator SUBSET ####'
|
'#### PoorMansRandomGenerator SUBSET ####'
|
||||||
'#### _OFUNCTIONS_BOOTSTRAP SUBSET ####'
|
'#### _OFUNCTIONS_BOOTSTRAP SUBSET ####'
|
||||||
'#### DEBUG SUBSET ####'
|
'#### DEBUG SUBSET ####'
|
||||||
|
@ -113,7 +117,7 @@ function __PREPROCESSOR_MergeSubset {
|
||||||
|
|
||||||
function __PREPROCESSOR_CleanDebug {
|
function __PREPROCESSOR_CleanDebug {
|
||||||
local source="${1}"
|
local source="${1}"
|
||||||
local destination="${2:-$PROGRAM.merge}"
|
local destination="${2:-$source}"
|
||||||
|
|
||||||
sed '/'$PARANOIA_DEBUG_BEGIN'/,/'$PARANOIA_DEBUG_END'/d' "$source" | grep -v "$PARANOIA_DEBUG_LINE" > "$destination.tmp"
|
sed '/'$PARANOIA_DEBUG_BEGIN'/,/'$PARANOIA_DEBUG_END'/d' "$source" | grep -v "$PARANOIA_DEBUG_LINE" > "$destination.tmp"
|
||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
|
@ -135,12 +139,15 @@ function __PREPROCESSOR_CleanDebug {
|
||||||
Logger "Prepared [$source]." "SIMPLE"
|
Logger "Prepared [$source]." "SIMPLE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chmod +x "$destination"
|
if [ "$source" != "$destination" ]; then
|
||||||
if [ $? != 0 ]; then
|
|
||||||
Logger "Cannot chmod [$destination]." "SIMPLE"
|
chmod +x "$destination"
|
||||||
exit 1
|
if [ $? != 0 ]; then
|
||||||
else
|
Logger "Cannot chmod [$destination]." "SIMPLE"
|
||||||
Logger "Prepared [$destination]." "SIMPLE"
|
exit 1
|
||||||
|
else
|
||||||
|
Logger "Prepared [$destination]." "SIMPLE"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue