Skip to content
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

Validates problem. Checks for missing files. Prompts to confirm submi… #1

Merged
merged 4 commits into from
Sep 18, 2016

Conversation

dmalan
Copy link
Member

@dmalan dmalan commented Sep 18, 2016

This version now assumes that we'll maintain a https://github.com/submit50/submit50 repo in which problem-specific metadata lives on problem-specific branches.

To test:

cd mario
touch mario.c LUIGI.C Makefile mario luigi core foo.h foo.c Makefile.extra
./submit50 mario

CC @brianyu28 @rbowden91 @glennholloway @dlloyd09 @thctamm @kzidane

curl --fail -o "$EXCLUDE" --silent "https://raw.githubusercontent.com/submit50/submit50/$problem/exclude"
if [[ $? -ne 0 ]]; then
echo "Invalid problem. Did you mean to submit something else?"
exit 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before exiting at line 39, delete $EXCLUDE.

if [[ "$line" =~ ^# ]]; then
file=$(sed 's/^[ \t]*//;s/[ \t]*$//' <<< "${line#?}")
if [[ ! -e "$file" ]]; then
files+=($file)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May as well put $file in double quotes on line 48, in case a file name containing a space ever shows up.

@dmalan dmalan merged commit 26de58d into master Sep 18, 2016
@dmalan
Copy link
Member Author

dmalan commented Sep 18, 2016

Thanks, @glennholloway!

@dmalan dmalan deleted the v1.1.0 branch September 18, 2016 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants