docs: Add info on standardized way to download files
This commit is contained in:
parent
c3e3c14dc7
commit
dd27d55587
1 changed files with 6 additions and 1 deletions
|
|
@ -24,7 +24,12 @@ These are general guidelines for writing official bash modules and their documen
|
|||
- If you want to insert another regular string as a suffix or prefix to the `"${variable_name}"`, you should do that in this format: `"prefix-${variable_name}-suffix"`
|
||||
- Use `set -euo pipefail` at the start of the script, to ensure that module will fail the image build if error is caught.
|
||||
- You can also use `set -euxo pipefail` during debugging, where each executed command is printed. This should not be used in a published module.
|
||||
|
||||
- For downloading files, we utilize `curl`. Here's the template for what we're using:
|
||||
- Download file with differently specified filename:
|
||||
`curl -fLs --create-dirs "${URL}" -o "${DIR}/${FILENAME.EXT}"`
|
||||
- Download file to directory with no filename changes:
|
||||
`curl -fLs --create-dirs -O "${URL}" --output-dir "${DIR}"`
|
||||
|
||||
Using [Shellcheck](https://www.shellcheck.net/) in your editor is recommended.
|
||||
|
||||
### Documentation
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue