Skip to content

cli: expand GitHub owner/repo shorthand in add-repo - #7

Open
zampierilucas wants to merge 27 commits into
KindleModding:mainfrom
zampierilucas:add-repo-github-shorthand
Open

zampierilucas wants to merge 27 commits into
KindleModding:mainfrom
zampierilucas:add-repo-github-shorthand

Conversation

@zampierilucas

Copy link
Copy Markdown

Searchbar `;` commands go through Amazon's `scriptExecutor`, which only lets `[A-Za-z0-9/_ -]` through in arguments, so add-repo can never get a URL from there (see #5).

This expands `owner/repo[/path]` into a raw GitHub URL on the default branch, with path defaulting to `manifest` and `.json` appended, so `;kpm add-repo KindleTweaks/Repo` works from the searchbar. Anything with a `.` or `:` in it goes through untouched like before.

Tested on a host build with `KindleTweaks/Repo`, `zampierilucas/kindle-hid-passthrough/kpm/repo` and `zampierilucas/kindle-button-mapper-rs/kpm/repo`, all three add and index fine after `kpm update`.

Fixes #5

The Kindle searchbar runs ; commands through scriptExecutor, which only
lets [A-Za-z0-9/_ -] through in arguments, so a URL can never reach
add-repo from there. Expand owner/repo[/path] into a raw GitHub URL on
the default branch, with path defaulting to manifest and .json appended.

Fixes KindleModding#5

Signed-off-by: Lucas Zampieri <lcasmz54@gmail.com>
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.

add-repo with URL silently returns to the home screen

2 participants