forked from 10XGenomics/enclone
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·493 lines (438 loc) · 23.9 KB
/
install.sh
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
#!/bin/bash
# Note that we call this script using "bash -c", and that's what determines the shell,
# not the first line of this file.
# This is the installation and update script for enclone. For instructions on how to
# run it, please see bit.ly/enclone. A few more details are here.
#
# Run shellcheck if you change this script: you'll need to sort wheat from chaff.
#
# Be very careful about ADDING lines to this script. Please treat every line as a liability
# and dangerous. At one time the script included code to test if the install worked and if not
# print debugging information. This was a bad idea. Now instead, the user is directed to a
# debugging page, which has them run some things, including a separate debugging script.
# Less here is more.
# ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
# This reuses code from the installation script for the rust language.
#
# This script expects a single argument, which is small, medium, large or colossus, depending on how
# much data is to be downloaded.
#
# If you run it a second time and forget the size, it will use the same size as last time,
# and state that.
#
# Note that version15 is hardcoded!
# ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
# Get command line arguments. The second and third arguments are for testing.
# The third argument can be force_wget.
size=$1
if ! [ -z "$2" ]; then
HOME=$2
fi
if ! [ -z "$3" ]; then
MODE=$3
fi
# ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
main() {
# ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
# 1. Set up; test for existence of needed system commands.
#
# We require only one of curl or wget. The reason for not requiring curl is that at
# the time of writing this script, the standard Ubuntu install did not include curl,
# and so it is possible that someone would not have curl.
#
# We do not use svn, because it is no longer available by default on MacOS.
#
# Sadly, no longer is git. We therefore include a special test for it.
need_cmd date
STARTTIME=$(date +%s)
# special test for git
git --version >& /dev/null
if ! [ "$?" -eq "0" ]; then
printf "\nIt would appear that you do not have the command line tool git installed.\n"
printf "This is a common problem. To solve it, please type\n"
printf "xcode-select --install\n"
printf "and follow the instructions, and then rerun the enclone installation command.\n\n"
exit 1
fi
# We used to have "set -e" here to force exit upon error. However that is inconsistent with
# several parts of the code that allow for a command to fail and then check status.
# There has to have been a reason why we added set -e. If we figure out what it was, we can
# protect the specific parts of code that need protection.
need_cmd awk
need_cmd chmod
need_cmd grep
need_cmd mkdir
need_cmd uname
need_cmd zcat
if [ "$size" = colossus ]; then
need_cmd gzip
need_cmd tar
fi
local _have_curl
_have_curl=false
if check_cmd curl; then
if [ "$MODE" != force_wget ]; then
_have_curl=true
fi
fi
if ! $_have_curl && ! check_cmd wget; then
printf "\nenclone installation failed because neither the command curl nor the\n"
printf "command wget could be found. This is strange and unexpected.\n"
printf "If you're stuck please ask for help by emailing [email protected].\n\n"
exit 1
fi
# ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
# 2. Determine if this is a Linux or Mac box; fail if it is not one of these two.
local _ostype
_ostype="$(uname -s)"
if [ "$_ostype" != Linux ] && [ "$_ostype" != Darwin ]; then
echo
echo "enclone install script fails because operating system type ${_ostype}" \
"is unknown."
echo "If you're stuck please ask for help by emailing [email protected]."
echo
exit 1
fi
# ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
# 3. Get requested size.
if [ "$size" != small ] && [ "$size" != medium ] && [ "$size" != large ] && [ "$size" != colossus ]; then
printf "\nTo install or update enclone, please supply the single argument SIZE to the\n"
printf "curl command shown on bit.ly/enclone. The argument SIZE can be small, medium, "
printf "large, or colossus.\n"
echo "If you're stuck please ask for help by emailing [email protected]."
echo
exit 1
fi
# ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
# 4. Determine if datasets are current.
#
# Because there has been only one release of the large dataset collection, if it
# was downloaded, then it is current.
local _datasets_small_current _datasets_medium_current _datasets_large_current
local _datasets_colossus_current
local _datasets_small_checksum_master _datasets_small_checksum_local
local _datasets_medium_checksum_master _datasets_medium_checksum_local
_datasets_small_current=false
_datasets_medium_current=false
_datasets_large_current=false
_datasets_colossus_current=false
raw_repo=https://raw.githubusercontent.com/10XGenomics/enclone
if [ "$size" = small ]; then
if [ $_have_curl ] && [ "$MODE" != force_wget ]; then
_datasets_small_checksum_master=$(curl -s $raw_repo/master/datasets_small_checksum)
else
_datasets_small_checksum_master=$(wget -q $raw_repo/master/datasets_small_checksum -O -)
if ! [ "$?" -eq "0" ]; then
printf "\nfailed: wget -q $raw_repo/master/datasets_small_checksum\n"
printf "This is strange and unexpected.\n"
echo "If you're stuck please ask for help by emailing [email protected]."
echo
exit 1
fi
fi
fi
if test -f "$HOME/enclone/datasets_small_checksum"; then
_datasets_small_checksum_local=$(cat $HOME/enclone/datasets_small_checksum)
if [ "$_datasets_small_checksum_local" = "$_datasets_small_checksum_master" ]; then
_datasets_small_current=true
fi
fi
if [ "$size" = medium ] || [ "$size" = large ] || [ "$size" = colossus ]; then
raw_master=$raw_repo/master
if $_have_curl; then
_datasets_medium_checksum_master=$(curl -s $raw_master/datasets_medium_checksum)
else
_datasets_medium_checksum_master=$(wget -q $raw_master/datasets_medium_checksum -O -)
if ! [ "$?" -eq "0" ]; then
printf "\nfailed: wget -q $raw_repo/master/datasets_medium_checksum\n"
printf "This is strange and unexpected.\n"
echo "If you're stuck please ask for help by emailing [email protected]."
echo
exit 1
fi
fi
fi
if test -f "$HOME/enclone/datasets_medium_checksum"; then
_datasets_medium_checksum_local=$(cat $HOME/enclone/datasets_medium_checksum)
if [ "$_datasets_medium_checksum_local" = "$_datasets_medium_checksum_master" ]; then
_datasets_medium_current=true
fi
fi
if test -f "$HOME/enclone/datasets2/download_complete"; then
_datasets_large_current=true
fi
if test -f "$HOME/enclone/datasets2/1287207/outs/count/feature_barcode_matrix.bin"; then
_datasets_colossus_current=true
fi
# ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
# 5. Determine if the local enclone executable is current.
#
# This is quite hideous. There must be a better way.
local _current_version _enclone_is_current _is_update
repo=https://github.com/10XGenomics/enclone
if $_have_curl; then
_current_version=$(curl -sI $repo/releases/latest/download/enclone_linux | \
grep -i "^location:" | tr '/' ' ' | cut -d ' ' -f9)
else
_current_version=$(wget --server-response --max-redirect=0 \
$repo/releases/latest/download/enclone_linux |& \
grep -i " location:" | tr '/' ' ' | cut -d ' ' -f11)
fi
_enclone_is_current=false
if test -f "$HOME/bin/enclone"; then
_is_update=true
local _local_version
if test -f "$HOME/enclone/version"; then
_local_version=$(cat $HOME/enclone/version)
if [ "$_local_version" == "$_current_version" ]; then
printf "\nThe local version of enclone is current so not downloading executable. "
printf "Both versions are $_local_version.\n"
_enclone_is_current=true
fi
fi
fi
# ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
# 6. Make directory ~/bin if needed and download the appropriate enclone executable into it.
#
# There is some complicated stuff that happens with temporarily moving the enclone executable.
# This is there so that when this script is called from enclone UPDATE, the executable in use
# is not clobbered. There were failures associated with this.
cd $HOME
mkdir -p bin
mkdir -p enclone
if [ "$_enclone_is_current" = false ]; then
cd bin
if [ "$_ostype" = Linux ]; then
if $_have_curl; then
printf "\nDownloading Linux version of latest enclone executable using curl.\n\n"
curl -s -L $repo/releases/latest/download/enclone_linux --output enclone
if ! [ "$?" -eq "0" ]; then
printf "ran curl -s -L $repo/releases/latest/download/enclone_linux "
# mess below because sh is finicky about -
printf "-"
printf "-"
printf "output enclone\n"
printf "\nthat command appears to have failed\n\n"
printf "current working directory is $PWD\n\n"
printf "printing curl version\n\n"
curl --version
printf "\nmoving enclone executable aside preparatory to retrying\n\n"
rm -f enclone.aside
mv enclone enclone.aside
if ! [ "$?" -eq "0" ]; then
printf "\nattempt to move enclone aside failed\n"
exit 1
fi
printf "retrying curl\n\n"
curl -s -L $repo/releases/latest/download/enclone_linux --output enclone
if ! [ "$?" -eq "0" ]; then
printf "the command appears to have failed again\n\n"
printf "giving up\n\n"
printf "If you ran this using enclone UPDATE, please instead try running "
printf "the install command on bit.ly/enclone directly.\n\n"
exit 1
fi
printf "\nok that seems to have succeeded\n\n"
rm -f enclone.aside
fi
else
printf "\nDownloading Linux version of latest enclone executable using wget.\n\n"
wget -q $repo/releases/latest/download/enclone_linux -O enclone
if ! [ "$?" -eq "0" ]; then
printf "\nwget appears to have failed\n\n"
fi
fi
fi
if [ "$_ostype" = Darwin ]; then
printf "\nDownloading the Mac version of the latest enclone executable.\n\n"
if $_have_curl; then
curl -s -L $repo/releases/latest/download/enclone_macos --output enclone
else
wget -q $repo/releases/latest/download/enclone_macos -O enclone
fi
fi
echo "Done downloading the enclone executable."
# set execute permission on the enclone executable
chmod +x enclone
cd ..
# record local version
echo "$_current_version" > enclone/version
fi
# ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
# 7. Add ~/bin to bash path if needed.
#
# This does nothing if you already have ~/bin in your path.
#
# This is complicated because some versions of Linux use the file .bash_profile,
# and some use .profile.
# If the instructions here don't work, this post may be helpful:
# https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path.
#
# Note for this section and the next: putting ~/bin in the user's path will not necessarily
# work. Instead they should have <home dir>/bin, as in the commands below.
if [[ ":$PATH:" != *":$HOME/bin:"* ]]; then
test -r .bash_profile && echo 'PATH=$HOME/bin:$PATH' >> .bash_profile || \
echo 'PATH=$HOME/bin:$PATH' >> .profile
fi
# ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
# 8. Add $HOME/bin to zsh path if needed.
#
# (a) If .zshrc exists and we have not already added $HOME/bin to the PATH in it, do so.
# (b) If .zshrc does not exist but the user shell is zsh, add $HOME/bin as above.
if [ -f .zshrc ]; then
if [[ `cat .zshrc` != *"export PATH=$HOME/bin:"* ]]; then
echo 'export PATH="$HOME/bin:$PATH"' >> .zshrc
fi
elif [[ "$SHELL" == "/bin/zsh" ]]; then
echo 'export PATH="$HOME/bin:$PATH"' > .zshrc
fi
# ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
# 9. Record size.
echo "$size" > enclone/size
# ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
# 10. Download small data.
if [ "$size" = small ]; then
if [ "$_datasets_small_current" = false ]; then
printf "\nDownloading small version of datasets.\n"
printf "This seems to take roughly five seconds, even over home wireless.\nHowever "
printf "it could be slower on a particular day or because of your connection.\n\n"
mkdir -p enclone/datasets
rm -rf enclone/datasets/123085
cd enclone/datasets
mkdir -p 123085/outs
cd 123085/outs
json="all_contig_annotations.json.lz4"
url="https://github.com/10XGenomics/enclone-data/raw/master/big_inputs/version15/123085/outs/$json"
if $_have_curl; then
curl -s -L $url -O
else
wget -q $url
fi
cd ../../../..
echo "$_datasets_small_checksum_master" > enclone/datasets_small_checksum
printf "Done with that download.\n"
else
printf "\nSmall version of datasets already current so not downloading.\n"
fi
fi
# ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
# 11. Download medium data.
#
# This is not optimal, because if anything changed, all the files get re-downloaded.
if [ "$size" = medium ] || [ "$size" = large ] || [ "$size" = colossus ]; then
if [ "$_datasets_medium_current" = false ]; then
echo
if [ "$size" = medium ]; then
echo "Downloading medium version of datasets."
fi
if [ "$size" = large ]; then
echo "Downloading medium version of datasets, as part of large."
fi
if [ "$size" = colossus ]; then
echo "Downloading medium version of datasets, as part of colossus."
fi
printf "This seems to take roughly thirty seconds, even over home wireless.\nHowever"
printf "it could be slower on a particular day or because of your connection.\n\n"
rm -rf enclone/datasets enclone/version15
cd enclone
git clone --depth=1 https://github.com/10XGenomics/enclone-data.git
mv enclone-data/big_inputs/version15 datasets
rm -rf enclone-data
cd ..
echo "$_datasets_medium_checksum_master" > enclone/datasets_medium_checksum
printf "Done with that download.\n"
# Remove a funny-looking directory, which is used by enclone only to test if
# weird unicode characters in a path will break it.
rm -rf enclone/datasets/█≈ΠΠΠ≈█
else
printf "\nMedium version of datasets already current so not downloading them.\n"
fi
fi
# ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
# 12. Download large data.
if [ "$size" = large ] || [ "$size" = colossus ]; then
if [ "$_datasets_large_current" = false ]; then
if [ "$size" = large ]; then
printf "\nDownloading large version of datasets.\n"
fi
if [ "$size" = colossus ]; then
printf "\nDownloading large version of datasets, as part of colossus.\n"
fi
printf "This seems to take roughly one to three minutes, even over home wireless.\n"
printf "However it could be slower on a particular day or because of your connection.\n\n"
cd enclone
rm -rf datasets2
aws=https://s3-us-west-2.amazonaws.com
if $_have_curl; then
curl -s $aws/10x.files/supp/cell-vdj/enclone_data_2.0.tar.gz -O
else
wget -q $aws/10x.files/supp/cell-vdj/enclone_data_2.0.tar.gz
fi
cat enclone_data_2.0.tar.gz | zcat | tar xf -
rm enclone_data_2.0.tar.gz
mv enclone_data_2.0 datasets2
cd ..
touch enclone/datasets2/download_complete
printf "Done with that download.\n"
else
printf "\nLarge version of datasets already current so not downloading them.\n"
fi
fi
# ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
# 13. Download colossus data.
if [ "$size" = colossus ]; then
if [ "$_datasets_colossus_current" = false ]; then
printf "\nDownloading colossus version of datasets.\n"
printf "This takes roughly ten minutes.\nHowever "
printf "it could be slower on a particular day or because of your connection.\n\n"
cd enclone
rm -rf datasets/1279* datasets/1287*
if $_have_curl; then
curl -L -s https://figshare.com/ndownloader/files/34846953 --output test_data.tar.gz
else
wget -q https://figshare.com/ndownloader/files/34846953 -O test_data.tar.gz
fi
gzip -d test_data.tar.gz
if ! [ "$?" -eq "0" ]; then
printf "\ngzip failed, giving up\n\n"
fi
cat test_data.tar | tar xf -
if ! [ "$?" -eq "0" ]; then
printf "\ntar failed, giving up\n\n"
fi
mv test_data/* datasets2
rmdir test_data
rm test_data.tar
else
printf "\nColossus version of datasets already current so not downloading them.\n"
fi
fi
# ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
# 14. Succesfully completed.
ENDTIME=$(date +%s)
echo
if [ "$_is_update" = true ]; then
echo "enclone update took $(($ENDTIME - $STARTTIME)) seconds."
else
echo "enclone installation took $(($ENDTIME - $STARTTIME)) seconds."
fi
printf "\n"
printf "🌸 Please CLOSE this terminal window and open a new one. Then type 🌸\n"
printf "🌸 enclone --check 🌸\n"
printf "🌸 If that works, great! Otherwise please seek help at 🌸\n"
printf "🌸 bit.ly/enclone_install_issues 🌸\n"
printf "\nAll done, have a lovely day!\n\n"
}
# ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
need_cmd() {
if ! check_cmd "$1"; then
printf "\nenclone installation faileds because the command $1 was not found.\n"
printf "If you're stuck please ask for help by emailing [email protected].\n"
printf "It is possible that we can rewrite the script to not use $1.\n\n"
exit 1
fi
}
check_cmd() {
command -v "$1" > /dev/null 2>&1
}
main