Skip to content

Commit

Permalink
Merge pull request #124 from madsi1m/aarnetfilesender
Browse files Browse the repository at this point in the history
aarnetfilesender: add error checking and other minor niceness
  • Loading branch information
mthang authored Sep 17, 2024
2 parents 479cabf + f00efb5 commit 10f536f
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions tools/aarnetfilesender/filesender.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,32 @@
<requirements>
<requirement type="package" version="3.0.0">filesendercli</requirement>
</requirements>
<command><![CDATA[
<command detect_errors="exit_code"><![CDATA[
#set $apiuser = $__user__.extra_preferences.get('aarnet_filesender_account|username', "").strip()
#set $apikey = $__user__.extra_preferences.get('aarnet_filesender_account|apikey', "").strip()
#if $apiuser == "":
echo "ERROR: Please enter your FileSender Username in your user preferences under the AARNet FileSender Account Info section" &&
exit 1;
#end if
#if $apikey == "":
echo "ERROR: Please enter your FileSender API Key in your user preferences under the AARNet FileSender Account Info section" &&
exit 1;
#end if
#if $to == "":
echo "WARNING: recipent email not set, setting to $__user_email__" &&
#set $to = $__user_email__
#end if
mkdir filestosend &&
#for $file in $data
if [ -f "filestosend/${file.element_identifier}" ]; then
echo "ERROR: two datasets have the same name (${file.element_identifier})" &&
exit 1;
fi &&
ln -s "$file" "filestosend/${file.element_identifier}" &&
#end for
Expand All @@ -32,9 +50,5 @@ filesender -p -u '$apiuser' -a '$apikey' -b https://filesender.aarnet.edu.au/res
**Remarks**
This tool leverages AARNet's FileSender (https://filesender.aarnet.edu.au)
to send files out of Galaxy.

If selecting multiple datasets, make sure each dataset is named
differently; otherwise, only one copy of the selected datasets will be
sent.
</help>
</tool>

0 comments on commit 10f536f

Please sign in to comment.