Skip to content

Commit

Permalink
a little script to generate an arbitrarily sized (with dummy small ha…
Browse files Browse the repository at this point in the history
…ndles) dummy collection
  • Loading branch information
yarikoptic committed Nov 20, 2015
1 parent b8a4f6d commit f1b73ae
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/examples/make_large_bogus_collection.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
# This generates arbitrarily large bogus collection with the specified in the command line number of handles
# which have some random very short description, author and license

set -eu

n=$1

rword() {
WORDLINE=$((($RANDOM * $RANDOM) % $(wc -w /usr/share/dict/words | awk '{print $1}')))"p" && sed -n $WORDLINE /usr/share/dict/words
}

c=bogus-${n}_collection
datalad create-collection $c

for i in `seq 1 $n`; do
h=bogus$i-$n
datalad create-handle $h
( cd $h;
git annex addurl "http://www.onerussian.com/tmp/banner.png" --file "Banner for $h"
git commit -m "Our banner for $h"

datalad describe \
--author "`rword` `rword`" \
--license "`rword`" \
--description "`rword` `rword`
`rword`
`rword` `rword` `rword`
"
cd ..
# add
datalad add-handle $h $c
)
done

0 comments on commit f1b73ae

Please sign in to comment.