-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpatch
More file actions
executable file
·35 lines (28 loc) · 864 Bytes
/
Copy pathpatch
File metadata and controls
executable file
·35 lines (28 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
if [[ ! -f "/usr/local/bin/smv" ]]; then
echo "error: Could not find SmartVersion executable in /usr/local/bin."
exit 1
fi
if [[ $1 == "" ]]; then
echo "usage: ./patch source-file target-file"
exit 1
fi
if [[ $2 == "" ]]; then
echo "usage: ./patch source-file target-file"
exit 1
fi
if [[ ! -f "$1" ]]; then
echo "error: Could not find source file."
exit 1
fi
if [[ ! -f "$2" ]]; then
echo "error: Could not find target file."
exit 1
fi
# -nbhashbits 24 -compressratio 192: https://forums.mydigitallife.net/threads/smartversion-tools-scripts.79415/page-14#post-1599203
if ! "/usr/bin/env" "smv" BuildPatch "${1%.*}_to_${2%.*}.svf" $1 $2 -nbhashbits 24 -compressratio 192 -sha1 -sha256; then
echo "error: Could not patch files."
exit 1
fi
echo "success: Successfully patched files."
exit 0