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

Scripts changes #747

Merged
merged 6 commits into from
Nov 1, 2021
Merged

Scripts changes #747

merged 6 commits into from
Nov 1, 2021

Conversation

EricClaeys
Copy link
Collaborator

Misc fixes and changes.

Also remove temporary resized, uploaded file.
Other minor changes.
Added check for missing directory.
Remove unnecessary code (every other script assumes $EXTENSION exists).
Removed unneeded "cd $ALLSKY_HOME".
Set defaults in one place so it's easier to remove them in the future when we know they are in the unified configuration file.
Misc minor changes.
Didn't handle incorrect arguments very well, e.g.:   `generateForDay.sh -t`  would say "-t not found`.
RET=$?

# If we created a temporary copy, delete it.
[ "${RESIZE_UPLOADS}" = "true" ] && rm -f "${IMAGE_TO_USE}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I realize this contains ${ALLSKY_TMP}/${FULL_FILENAME}, but let's use the expanded version ( as I provided it here ), instead of ${IMAGE_TO_USE}. This helps eliminate confusion during future code reviews.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@linuxkidd, not sure I understand your comment. Almost all the scripts use ${IMAGE_TO_USE} as the name of the current image being processed. This makes it easier to change locations of the file (like putting in in $ALLSKY_TMP in the near future) since only one line per script needs to change.

What do you mean by "as I provided it here"? I only see a few lines of newly added code in your reply that removes a temporary file.

IMGDIR is the old name; changed to use new name IMAGE_DIR.
Using IMAGE_TO_USE for the temporary file was confusing and dangerous.
It now uses TEMP_FILE for the uploaded file being resized.
@EricClaeys EricClaeys requested a review from linuxkidd November 1, 2021 02:58
@linuxkidd linuxkidd merged commit 983f7fb into master Nov 1, 2021
@EricClaeys EricClaeys deleted the scripts-changes branch November 1, 2021 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants