mirror of
https://github.com/sharkdp/bat.git
synced 2025-01-11 16:18:21 +01:00
assets/create.sh: Reverse patches even if bat cache
fails or aborts
This commit is contained in:
parent
a3ea798246
commit
84a15f0b6e
10
assets/create.sh
vendored
10
assets/create.sh
vendored
@ -46,6 +46,7 @@ bat cache --clear
|
|||||||
# - Remove the JavaDoc patch once https://github.com/trishume/syntect/issues/222 has been fixed
|
# - Remove the JavaDoc patch once https://github.com/trishume/syntect/issues/222 has been fixed
|
||||||
# - Remove the C# patch once https://github.com/sublimehq/Packages/pull/2331 has been merged
|
# - Remove the C# patch once https://github.com/sublimehq/Packages/pull/2331 has been merged
|
||||||
|
|
||||||
|
# Apply patches
|
||||||
(
|
(
|
||||||
cd "$ASSET_DIR"
|
cd "$ASSET_DIR"
|
||||||
for patch in patches/*.patch; do
|
for patch in patches/*.patch; do
|
||||||
@ -53,11 +54,16 @@ bat cache --clear
|
|||||||
done
|
done
|
||||||
)
|
)
|
||||||
|
|
||||||
bat cache --build --blank --acknowledgements --source="$ASSET_DIR" --target="$ASSET_DIR"
|
reverse_patches() {
|
||||||
|
|
||||||
(
|
(
|
||||||
cd "$ASSET_DIR"
|
cd "$ASSET_DIR"
|
||||||
for patch in patches/*.patch; do
|
for patch in patches/*.patch; do
|
||||||
patch --strip=0 --reverse <"$patch"
|
patch --strip=0 --reverse <"$patch"
|
||||||
done
|
done
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Make sure to always reverse patches, even if the `bat cache` command fails or aborts
|
||||||
|
trap reverse_patches EXIT
|
||||||
|
|
||||||
|
bat cache --build --blank --acknowledgements --source="$ASSET_DIR" --target="$ASSET_DIR"
|
||||||
|
Loading…
Reference in New Issue
Block a user