make stub before building and include project info
This commit is contained in:
parent
2bfb810817
commit
68e857afce
|
@ -1,9 +1,10 @@
|
|||
BuildProject() {
|
||||
echo "Building from $1"
|
||||
local files
|
||||
MakeStub "$1"
|
||||
mapfile -t files < <(ProcessBuildFile "$1")
|
||||
for ((i=0;i<"${#files[*]}";i++));do
|
||||
grep -Ev '^\s*\#' "${files[$i]}";
|
||||
done > "${config[build_path]}$1.sh"
|
||||
AddShebang "$1"
|
||||
done >> "${config[build_path]}$1.sh"
|
||||
# AddShebang "$1"
|
||||
}
|
||||
|
|
|
@ -16,4 +16,14 @@ Configure() {
|
|||
config[$varname]=$(echo "$line" | cut -d '=' -f 2-)
|
||||
fi
|
||||
done < "${config[config_path]}"/"${config[config_file]}"
|
||||
|
||||
local pattern="*.info"
|
||||
|
||||
if [ -f $pattern ]; then
|
||||
for file in *.info; do
|
||||
. "$file"
|
||||
done
|
||||
else
|
||||
echo 'Project info not found. Have you initialized a project?' && exit 0;
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
MakeStub() {
|
||||
echo '#!/bin/bash' > "${config[build_path]}$1.sh"
|
||||
cat "${projectName,,}"'.info' >> "${config[build_path]}$1.sh"
|
||||
}
|
Loading…
Reference in New Issue