-
Notifications
You must be signed in to change notification settings - Fork 568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
non interactive ww3_from_ftp.sh #603
non interactive ww3_from_ftp.sh #603
Conversation
add option --no-check-certificate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested that at my end, it worked as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not opposed to this PR as is, but had some different thoughts when I originally made the issue #578 so thought I'd get your thoughts on that before we merge.
model/bin/ww3_from_ftp.sh
Outdated
if [ $# -eq 3 ] ; then | ||
interactive='n' | ||
ww3dir=$1 # [ '../../'] | ||
wnew=$2 # ['y'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we combine this to just have one option?
model/bin/ww3_from_ftp.sh
Outdated
interactive='y' | ||
if [ $# -eq 3 ] ; then | ||
interactive='n' | ||
ww3dir=$1 # [ '../../'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be more consistent with other scripts should we update this to be pointing to the model directory instead of the top level directory?
#Get top level directory of ww3 from user: | ||
echo -e "\n\n This script will download data from the ftp for WAVEWATCH III " | ||
echo -e "Enter the relative path to the main/top level directory, this would " | ||
echo -e "be '../../' if in the model/bin directory or '.' if already in the " | ||
echo -e "top/main directory:" | ||
read ww3dir | ||
if [ "$interactive" = "n" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice as it allows for previous functionality//backwards compatibility, but we're at a point where we're about to have some big changes and therefore are we willing to break this and just make this a script where you have to give it the model directory path and then you either keep things (optional, make an option) or the default is you do nothing and it doesn't keep things?
let me know if this version fits better to your expectations : |
Okay, I did something wrong:
If we have -k for keeping the tar files, do we still need to have the "y y"? I thought that was the default behavior now. |
model/bin/ww3_from_ftp.sh
Outdated
|
||
model_dir=$(cd $(dirname $(dirname $0)) > /dev/null && pwd -P) | ||
echo $model_dir | ||
|
||
#Get top level directory of ww3 from user: | ||
echo -e "\n\n This script will download data from the ftp for WAVEWATCH III " | ||
echo -e "Enter the relative path to the main/top level directory, this would " | ||
echo -e "be '../../' if in the model/bin directory or '.' if already in the " | ||
echo -e "top/main directory:" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're giving the path to the model directory, we should change this description or is this still the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
you don't need anymore to specify the model directory since it is detected automatically |
I've added usage to make it clearer and I'm also updating the PR summary |
correct option to keep tar files
ok this version should be the final one unless you see something to change/improve |
This is AWESOME!!! Thank you so much @mickaelaccensi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new usage and -h options are really nice. Great improvement! Thank you for implementing this update.
Pull Request Summary
change default behavior to automatically download tar files and detect main directory
add options :
-h : print usage
-i : interactive mode
-k : keep tar files
add download option --no-check-certificate
Description
solve issue #578
the new way to use it is to add arguments in the command line :
cd WW3/model/bin/ww3_from_ftp.sh
Issue(s) addressed
fixes #578
Commit Message
non interactive ww3_from_ftp.sh
Check list
Testing
by running the bash script itself