File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 3
3
## Unreleased
4
4
5
5
1 . Replaced status messages with nicer, easier-to-read messages in color.
6
+
7
+ 2 . Added error checking for presence of wimlib tools and ESD image before starting.
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ _twrap() {
24
24
_qtput sgr0
25
25
}
26
26
bold () { _twrap " $1 " bold; }
27
+ red () { _twrap " $1 " setaf 1; }
27
28
green () { _twrap " $1 " setaf 2; }
28
29
blue () { _twrap " $1 " setaf 4; }
29
30
@@ -33,7 +34,28 @@ print_subtask() { echo "$(blue "==>") $(bold "$@")"; }
33
34
set -e
34
35
setup_color
35
36
36
- esd=" ${1} "
37
+ if [ -z " $1 " ] || [ " $1 " = " -h" ]; then
38
+ echo " $( red " Usage:" ) $( basename " $0 " ) ESD"
39
+ exit 0
40
+ fi
41
+
42
+ check_tool () {
43
+ if ! which " $1 " > /dev/null; then
44
+ echo " $( red " Error:" ) wimlib tools not found"
45
+ exit 1
46
+ fi
47
+ }
48
+ check_tool wiminfo
49
+ check_tool wimapply
50
+ check_tool wimexport
51
+
52
+ esd=" $1 "
53
+
54
+ if [ ! -f " ${esd} " ]; then
55
+ echo " $( red " Error:" ) ${esd} not found"
56
+ exit 2
57
+ fi
58
+
37
59
tmpdir=$( mktemp -d)
38
60
39
61
__cleanup () {
You can’t perform that action at this time.
0 commit comments