Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenwrite.git

Moved instructions into scripts

AuthorDaveJarvis <email>
Date2020-09-16 20:26:48 GMT-0700
Commitbc4f7433f7af2323a80df12728d7c25440161e42
Parentf603d1e
Delta13 lines added, 17 lines removed, 4-line decrease
logging/README.md
# Usage
-Run `Main` by passing the name of the Java class file to parse as follows:
-
- pushd ../src/main/java
- for i in $(find . -type f -name "*.java"); do \
- java -cp ../../../logging/jp.jar com.github.javaparser.Main "$i" > \
- "$i.jp";
- done
-
-That command creates a series of processed Java files with a `.jp` extension.
-Replace the original files with the updated versions as follows:
-
- find . -type f -name "*jp" -size +100c -exec \
- sh -c 'mv {} $(dirname {})/$(basename {} .jp)' \;
-
-The `+100c` is ensures that files without contents do not overwrite
-existing files. Not sure why 0-byte files are created.
+Run the `inject` script to replace the original files with the logging
+versions.
# Revert
When finished building a debug version of the application, reset the repo
as follows:
- popd
git reset --hard HEAD
logging/inject
+#!/usr/bin/env bash
+
+echo "Parsing"
+find ../src/main/java -type f -name "*.java" -exec \
+ sh -c 'echo {}; java -cp jp.jar com.github.javaparser.Main {} > {}.jp' \;
+
+echo "Renaming"
+# The +10c ensures that files without code are skipped.
+find ../src/main/java -type f -name "*.jp" -size +10c -exec \
+ sh -c 'echo {}; mv {} $(dirname {})/$(basename {} .jp)' \;
+