3
3
set -euC -o pipefail
4
4
5
5
readonly source_dir=' gix-packetline/src'
6
- readonly target_parent_dir =' gix-packetline-blocking'
7
- readonly target_dir =" $target_parent_dir /src"
6
+ readonly destination_parent_dir =' gix-packetline-blocking'
7
+ readonly destination_dir =" $destination_parent_dir /src"
8
8
9
9
function fail () {
10
10
printf ' %s: error: %s\n' " $0 " " $1 " >&2
@@ -34,12 +34,12 @@ function merging () {
34
34
}
35
35
36
36
function target_dir_status () {
37
- git status --porcelain --ignored=traditional -- " $target_dir " ||
37
+ git status --porcelain --ignored=traditional -- " $destination_dir " ||
38
38
fail ' git-status failed'
39
39
}
40
40
41
- function check_target_dir () {
42
- if ! test -e " $target_dir " ; then
41
+ function check_destination_dir () {
42
+ if ! test -e " $destination_dir " ; then
43
43
# The target does not exist on disk, so nothing will be lost. Proceed.
44
44
return
45
45
fi
@@ -111,7 +111,7 @@ function generate_one () {
111
111
local source_file target_file
112
112
113
113
source_file=" $1 "
114
- target_file=" $target_dir ${source_file# " $source_dir " } "
114
+ target_file=" $destination_dir ${source_file# " $source_dir " } "
115
115
116
116
if test -d " $source_file " ; then
117
117
mkdir -p -- " $target_file "
@@ -134,13 +134,13 @@ function generate_all () {
134
134
if ! test -d " $source_dir " ; then
135
135
fail " no source directory: $source_dir "
136
136
fi
137
- if ! test -d " $target_parent_dir " ; then
138
- fail " no target parent directory: $target_parent_dir "
137
+ if ! test -d " $destination_parent_dir " ; then
138
+ fail " no target parent directory: $destination_parent_dir "
139
139
fi
140
- check_target_dir
140
+ check_destination_dir
141
141
142
- rm -rf -- " $target_dir " # It may be a directory, symlink, or regular file.
143
- if test -e " $target_dir " ; then
142
+ rm -rf -- " $destination_dir " # It may be a directory, symlink, or regular file.
143
+ if test -e " $destination_dir " ; then
144
144
fail ' unable to remove target location'
145
145
fi
146
146
0 commit comments