1 | #!/usr/bin/env bash
|
2 |
|
3 | BASEDIR=$(dirname "$0")
|
4 |
|
5 | source ${BASEDIR}/src/index.sh
|
6 |
|
7 |
|
8 | if ! hasCurl; then
|
9 | setupCurl
|
10 | fi
|
11 |
|
12 | distFilename="script-helpers"
|
13 | packageName="@freak2geek/script-helpers"
|
14 |
|
15 | printf "${BLUE}[-] Building \"${packageName}\"...${NC}\n"
|
16 |
|
17 | packageDist="${PROJECT_F2G_SCRIPTS_PATH}/dist/${distFilename}.sh"
|
18 | packageTmp="${PROJECT_F2G_SCRIPTS_PATH}/dist/tmp.sh"
|
19 |
|
20 |
|
21 | [[ -f ${packageDist} ]] && rm ${packageDist}
|
22 |
|
23 |
|
24 | for filename in ${PROJECT_F2G_SCRIPTS_PATH}/src/*.sh; do
|
25 | cat $filename >> ${packageTmp}
|
26 | done
|
27 |
|
28 | sedi '/^source .*/d' ${packageTmp}
|
29 | sedi '/\#\!\/usr\/bin\/env bash/d' ${packageTmp}
|
30 |
|
31 |
|
32 | echo "#!/usr/bin/env bash" >> ${packageDist}
|
33 |
|
34 | cat ${packageTmp} >> ${packageDist}
|
35 |
|
36 |
|
37 | [[ -f ${packageTmp} ]] && rm ${packageTmp}
|
38 |
|
39 | printf "${GREEN}[✔] Built \"${packageName}\"${NC}\n"
|