Trim script and style elements
This commit is contained in:
parent
b0bba546ce
commit
ca30897dae
9 changed files with 49 additions and 8 deletions
|
|
@ -1,14 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -Eeuo pipefail
|
||||
set -Eeo pipefail
|
||||
|
||||
pushd "$(dirname "$0")" >/dev/null
|
||||
|
||||
cargo build --manifest-path c14n/Cargo.toml --release
|
||||
cargo build --manifest-path charlines/Cargo.toml --release
|
||||
|
||||
for f in outputs/*/*; do
|
||||
src=$(cat "$f")
|
||||
c14n/target/release/c14n <<< "$src" > "$f"
|
||||
out=$(c14n/target/release/c14n < "$f")
|
||||
if [[ "$CHARLINES" == "1" ]]; then
|
||||
out=$(charlines/target/release/charlines <<< "$out")
|
||||
fi
|
||||
cat <<< "$out" > "$f"
|
||||
done
|
||||
|
||||
popd >/dev/null
|
||||
|
|
|
|||
2
debug/diff/charlines/.gitignore
vendored
Normal file
2
debug/diff/charlines/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
/Cargo.lock
|
||||
/target/
|
||||
5
debug/diff/charlines/Cargo.toml
Normal file
5
debug/diff/charlines/Cargo.toml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
[package]
|
||||
publish = false
|
||||
name = "charlines"
|
||||
version = "0.0.1"
|
||||
edition = "2018"
|
||||
3
debug/diff/charlines/README.md
Normal file
3
debug/diff/charlines/README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# charlines
|
||||
|
||||
Output each character from stdin onto its own stdout line. Useful for subsequence diffing when text does not naturally have a lot of line breaks (e.g. minified HTML).
|
||||
10
debug/diff/charlines/src/main.rs
Normal file
10
debug/diff/charlines/src/main.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
use std::io::{stdin, stdout, Read, Write};
|
||||
|
||||
fn main() {
|
||||
let mut src = Vec::new();
|
||||
stdin().read_to_end(&mut src).unwrap();
|
||||
let mut out = stdout();
|
||||
for c in src {
|
||||
out.write_all(&[c, b'\n']).unwrap();
|
||||
}
|
||||
}
|
||||
Reference in a new issue