Skip to content

Commit 0f3de58

Browse files
committed
introduce lang directory
Signed-off-by: Masatake YAMATO <[email protected]>
1 parent 07f18e1 commit 0f3de58

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*~
22
code/*
3+
lang/*
34
lcopy.d/private-*.lcopy
45
profile.d/private-*.ctags
56
results/*

codebase

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ clone_verify()
6969
if [[ ! -d code ]]; then
7070
ERROR 1 "no output directory"
7171
fi
72+
if [[ ! -d lang ]]; then
73+
ERROR 1 "no lang-link directory"
74+
fi
7275
}
7376

7477
#
@@ -157,6 +160,32 @@ hg_checkout()
157160
clone_prep()
158161
{
159162
mkdir -p code
163+
mkdir -p lang
164+
}
165+
166+
clone_lang_link()
167+
{
168+
local language=$1
169+
local odir=$2
170+
171+
mkdir -p lang/${language}
172+
if ! [[ -e lang/${language}/"${odir}" ]]; then
173+
ln -s ../../code/"${odir}" lang/${language}/"${odir}"
174+
fi
175+
176+
}
177+
178+
clone_langs_link()
179+
{
180+
local languages="$1"
181+
local odir="$2"
182+
local l
183+
(
184+
IFS=,
185+
for l in $languages; do
186+
clone_lang_link "$l" "${odir}"
187+
done
188+
)
160189
}
161190

162191
cmd_clone_run()
@@ -191,8 +220,10 @@ cmd_clone_run()
191220
member_csv "${language}" "${LANGUAGES}"; then
192221
type "${VCS}"_clone > /dev/null 2>&1 || ERROR 1 "no such vcs handler: ${VCS}"
193222
"${VCS}"_clone "${REPO}" "code/${odir}"
194-
cd "code/${odir}"
195-
"${VCS}"_checkout "${ALIGNMENT}"
223+
if ( cd "code/${odir}";
224+
"${VCS}"_checkout "${ALIGNMENT}"; ); then
225+
clone_langs_link "${LANGUAGES}" "${odir}";
226+
fi
196227
fi
197228
fi
198229
)

0 commit comments

Comments
 (0)