jtree
jtree copied to clipboard
build is adding whitespaces on unmodified files.
set -xeuo pipefail IFS=$'\n\t'
build creates invalid files on second run.
on consecutive runs of npm run build it generates invalid files. becaus the files have more spaces.
Steps to reproduce.
clean any previous build of this issue/script
rm -rf build_issue_jtree || true
Create a fresh install of jtree
gh repo clone breck7/jtree build_issue_jtree && cd ./build_issue_jtree && npm install ts-node && npm run cloc && npm run build
As you can see nothing has changed:
git status
Now let's swap the last two lines of projects.tree in order to trigger a rebuild.
input_file="products.tree";
tmp_file="products.temp";
awk 'NR>2{print last_but_one} {last_but_one=last; last=$0} END{print last; print last_but_one}' "${input_file}" > "${tmp_file}" && \
mv "${tmp_file}" "${input_file}"
Execute build again
npm run build || true
As you can see the build command already throws an error.
But what is it?
Now files have changed (although) they shouldn't have since we haven't done any changes to the contents them selves.
git status
What has changed?
git diff ./products/SandboxApp.browser.js