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

Test script to quickly test image url #8

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

julianlam
Copy link
Contributor

Execution: /mnt/us/dashboard/test.sh https://example.org/test.png

Executes wait-for-wifi.sh, downloads the image using ht (like dash.sh), and pushes it to the kindle via eips

Useful to quickly update images for testing purposes without starting the daemon.

@julianlam
Copy link
Contributor Author

julianlam commented Feb 1, 2021

Prior to this, every time I wanted to refresh the image, I had to run the commands by hand (ht, then eips), or run start.sh which kills the ssh session.

This just makes it easier to test 😄

If there was a simpler way, or if this script isn't to your standard, feel free to reject, I don't mind 😅

Copy link
Owner

@pascalw pascalw left a comment

Choose a reason for hiding this comment

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

Hey @julianlam thanks for this! I think it's indeed useful to have something like this to make testing dashboard images easier.

src/test.sh Outdated
echo "Refreshing dashboard"
"$DIR/wait-for-wifi.sh"

$(dirname $0)/ht -d -q -o "$DASH_PNG" get $1
Copy link
Owner

Choose a reason for hiding this comment

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

I wonder if we should change this to use local/fetch-dashboard.sh. The idea is that people should only have to modify files in local/ (to make upgrades easier). Fetching of the dashboard is extracted into a local script because it can be pretty case specific. For example in my case I need to provide authentication to the HTTP endpoint.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I'll allow fetch-dashboard.sh to handle an argument (which test.sh can opt to pass in).

Execution: `/mnt/us/dashboard/test.sh https://example.org/test.png`

Executes `wait-for-wifi.sh`, downloads the image using `ht` (like `dash.sh`), and pushes it to the kindle via `eips`

Useful to quickly update images for testing purposes without starting the daemon.
update fetch-dashboard.sh to allow passing in a separate argument for url
@julianlam
Copy link
Contributor Author

Done, let me know if I overstepped with the change to fetch-dashboard.sh

@@ -1,4 +1,4 @@
#!/usr/bin/env sh
# Fetch a new dashboard image, make sure to output it to "$1".
# For example:
$(dirname $0)/../ht -d -q -o "$1" get https://raw.githubusercontent.com/pascalw/kindle-dash/master/example/example.png
$(dirname $0)/../ht -d -q -o "$1" get ${2:-"https://raw.githubusercontent.com/pascalw/kindle-dash/master/example/example.png"}
Copy link
Owner

Choose a reason for hiding this comment

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

The additional argument is fine, np!

Maybe we can take this opportunity to make the arguments a bit more clear. Something like:

output_path="$1"
url="${2:-'https://raw.githubusercontent.com/pascalw/kindle-dash/master/example/example.png'}"

WDYT?

@pascalw
Copy link
Owner

pascalw commented Feb 8, 2021

@julianlam are you willing/able to make that change? If not let me know, I could do it too.

@julianlam
Copy link
Contributor Author

I haven't had the time actually 😅 please go ahead and make the change if you can, it is more difficult for me to do because I am just making the change blindly and pushing it to the kindle.

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.

None yet

2 participants