mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-01-11 15:08:03 -05:00
31 lines
778 B
Bash
31 lines
778 B
Bash
#!/bin/bash
|
|
# A little script to build the JavaScript repository on the
|
|
# web directory. Can be run to regenerate the repo in case
|
|
# it gets deleted accidentally.
|
|
#
|
|
FILDIR="/home/frs/project/coolprop/CoolProp"
|
|
WEBDIR="/home/project-web/coolprop/htdocs"
|
|
#
|
|
TARGETDIR="${WEBDIR}"/jscript
|
|
mkdir -p "${TARGETDIR}"
|
|
#
|
|
function parsePath {
|
|
local CURFILE="$1"
|
|
local CPVERSION=$(cut -d/ -f7 <<<"${CURFILE}")
|
|
local RES="${TARGETDIR}/coolprop-${CPVERSION}.js"
|
|
echo "${RES}"
|
|
}
|
|
#
|
|
JSFILES="$(find ${FILDIR} -iname '*coolprop.js')"
|
|
for CURFILE in $JSFILES; do
|
|
TARGETFILE="$(parsePath $CURFILE)"
|
|
rsync "${CURFILE}" "${TARGETFILE}"
|
|
done
|
|
#
|
|
pushd "${TARGETDIR}"
|
|
CURVER="$(ls | tail -n 3 | head -n 1)"
|
|
LATVER="coolprop-latest.js"
|
|
ln -sf "${CURVER}" "${LATVER}"
|
|
popd
|
|
exit 0
|