Allow using URL as archive source when creating functions (#1360)

In the case of large files, it takes a long time for the user to download
the source from the URL and upload it to StorgeSvc through CLI.

This PR allows a user to use URL as the function source when creating a function
and provides a new flag "--keeparchiveurl" to let the user to decided
whether the CLI should download the file first or store the file URL in the
archive directly. If "--keeparchiveurl" is true, then no checksum will be
generated, it's the user's responsibility to ensure the file won't be changed.
This commit is contained in:
Ta-Ching Chen
2019-10-28 22:37:13 +08:00
committed by GitHub
parent 52b5cb0902
commit d20dc9aa64
13 changed files with 299 additions and 84 deletions
+8
View File
@@ -54,6 +54,14 @@ if [ $(uname -s) == 'Darwin' ]; then
exit 1
fi
if command -v gsha256sum >/dev/null; then
sha256sum() { gsha256sum "$@"; }
export -f sha256sum
else
echo '"gsha256sum" command not found. Try "brew install coreutils".'
exit 1
fi
find_executable() {
path=$1; shift
find $path -perm +111 -type f "$@"