Skip to content

Commit

Permalink
Check distribution policy for Wikitongues only
Browse files Browse the repository at this point in the history
  • Loading branch information
smrohrer committed Sep 13, 2020
1 parent 1df6da8 commit c1ddd49
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
3 changes: 2 additions & 1 deletion getAirtableMetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ try {
});
fetchNextPage();
} else {
console.log(`\x1b[31mWarning! ID '${single}' not found on airtable.`)
console.log(`\x1b[31mWarning! ID '${single}' not found on airtable.`);
return process.exit(1);
}
}, function done(err) {
if (err) {
Expand Down
31 changes: 29 additions & 2 deletions loc.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#!/bin/bash

get_distribution () {
while read line; do
pat='Coverage: Distribution: (.*)'
[[ $line =~ $pat ]]
if [[ ! -z "${BASH_REMATCH[1]}" ]]; then
echo "${BASH_REMATCH[1]}"
break
fi
done < "./loctemp__${i}/${i}__metadata.txt"
}

if [ -z "$1" ]; then
printf "Usage: $ loc <directory name>\nPlease make sure you reference a desired oral history directory to prepare.\n"
else
Expand Down Expand Up @@ -32,16 +43,32 @@ else
exit 1
fi
done
else
for i in $@
do
touch "./loctemp__${i}/${i}__metadata.txt"
done
fi

find . | grep DS_Store | xargs rm

for i in $@
do
if [[ ! $LOC_Mode = "dev" ]]; then
if [[ $(get_distribution $i) = "Wikitongues only" ]]; then
echo "Skipping $i: Not for external distribution"
continue
fi
fi

echo "Processing $i"

loc-flatten "loctemp__$i" >> ~/loc-log

find . | grep DS_Store | xargs rm

loc-bag "loctemp__$i" >> ~/loc-log 2>&1

loc-release "loctemp__$i" >> ~/loc-log

done

echo "Done!"
Expand Down

0 comments on commit c1ddd49

Please sign in to comment.