#!/bin/sh # # Creates three raw files, and a lorry file specifying their downstream # subdirectories. # # Copyright (C) 2022 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. set -e # create the raw file directory repo="$DATADIR/raw-multiple-files-repo" mkdir "$repo" echo "first line, test 1" > "$repo/test_1.txt" echo "first line, test 2" > "$repo/test_2.txt" echo "first line, test 3" > "$repo/test_3.txt" # create the .lorry file for the raw file cat < $DATADIR/raw-multiple-files.lorry { "multiple-files-repo": { "type": "raw-file", "urls": [ { "url": "file://$repo/test_1.txt", "destination": "subdir_one" }, { "url": "file://$repo/test_2.txt", "destination": "subdir_one" }, { "url": "file://$repo/test_3.txt", "destination": "subdir_two" } ] } } EOF # create the working directory test -d "$DATADIR/work-dir" || mkdir "$DATADIR/work-dir"