Copy README.md/amalgamate_demo.cpp only if output dir isn't the same as ${SCRIPTPATH} (#1113)

+ use test's `-ef` file operator to check if ${SCRIPTPATH} and ${AMALGAMATE_OUTPUT_PATH} are not the same
This commit is contained in:
PavelP 2020-08-18 18:35:21 +06:00 committed by GitHub
parent 6beb5f5587
commit 78ce2b473e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -127,8 +127,11 @@ echo "/* auto-generated on ${timestamp}. Do not edit! */" > ${AMAL_C}
done
} >> ${AMAL_C}
# copy amalgamate_demo.cpp and README.md only if AMALGAMATE_OUTPUT_PATH is not the same as SCRIPTPATH
if [ ! ${SCRIPTPATH} -ef ${AMALGAMATE_OUTPUT_PATH} ]; then
cp -f "${SCRIPTPATH}/amalgamate_demo.cpp" "${DEMOCPP}"
cp -f "${SCRIPTPATH}/README.md" "${README}"
fi
echo "Done with all files generation."