-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
1,118 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o nounset | ||
set -o errexit | ||
set -o pipefail | ||
|
||
function usage { | ||
echo "Usage:" | ||
echo " ${0##*/} [options]" | ||
echo | ||
echo "Options:" | ||
echo " -h, --help Show the help message." | ||
echo " -l, --latest Pull down the latest release on GitHub." | ||
exit "$1" | ||
} | ||
|
||
# Defaults to a specific version for use in GitHub Actions | ||
DOWNLOAD_URL="https://github.com/adieuadieu/serverless-chrome/releases/download/v1.0.0-57/stable-headless-chromium-amazonlinux-2.zip" | ||
LOCAL_FILE="serverless-chrome.zip" | ||
LOCAL_DIR="tests/files/" | ||
|
||
|
||
# Get the URL of the latest stable release available | ||
function get_latest_stable_url { | ||
releases_url="https://api.github.com/repos/adieuadieu/serverless-chrome/releases" | ||
# Get the URL for the latest release's assets | ||
latest_assets=$(curl -s "$releases_url" | jq -r '.[0].assets_url') | ||
# Download the zip for the stable branch | ||
DOWNLOAD_URL=$(curl -s "$latest_assets" | jq -r '.[] | select(.browser_download_url | contains("stable")) | .browser_download_url') | ||
} | ||
|
||
while (( "$#" )) | ||
do | ||
case "$1" in | ||
-h|--help) | ||
usage 0 | ||
;; | ||
-l|--latest) | ||
get_latest_stable_url | ||
shift 1 | ||
;; | ||
-*) | ||
usage 1 | ||
;; | ||
esac | ||
done | ||
|
||
# Follow redirects and output as the specified file name | ||
curl -L --output "$LOCAL_FILE" "$DOWNLOAD_URL" | ||
# Extract the specified file to the specified directory and overwrite without | ||
# prompting | ||
unzip -o "$LOCAL_FILE" -d "$LOCAL_DIR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
"""The example library.""" | ||
"""The hash-http-content library.""" | ||
# Standard Python Libraries | ||
from typing import List | ||
|
||
# We disable a Flake8 check for "Module imported but unused (F401)" here because | ||
# although this import is not directly used, it populates the value | ||
# package_name.__version__, which is used to get version information about this | ||
# Python package. | ||
from ._version import __version__ # noqa: F401 | ||
from .example import example_div | ||
from .hasher import UrlHasher, UrlResult | ||
|
||
__all__ = ["example_div"] | ||
__all__: List[str] = ["UrlHasher", "UrlResult"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
"""Code to run if this package is used as a Python module.""" | ||
|
||
from .example import main | ||
from .cli import main | ||
|
||
main() |
File renamed without changes.
Oops, something went wrong.