Files
sausage/host/js/apply-patch.nu
T

16 lines
727 B
Nu

# Apply the versioned dist patch, or verify that all its hunks already exist.
let args = [-p1 -d node_modules/@earendil-works/pi-durable -i ../../../patches/pi-durable-1.5.0.patch --batch --fuzz=0]
let forward = (^patch ...$args --forward --dry-run | complete)
if $forward.exit_code == 0 {
^patch ...$args --forward
if $env.LAST_EXIT_CODE != 0 { error make {msg: "pi-durable patch failed"} }
} else {
let reverse = (^patch ...$args --force --reverse --dry-run | complete)
if $reverse.exit_code != 0 {
print $forward.stdout
print --stderr $forward.stderr
error make {msg: "pi-durable 1.5.0 patch does not match the installed package"}
}
print "pi-durable patch already applied"
}