mirror of
https://github.com/natelandau/shell-scripting-templates.git
synced 2025-11-17 09:23:39 -05:00
Compare commits
6 Commits
74523767af
...
5bf9f3657d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5bf9f3657d | ||
|
|
69c1b491bb | ||
|
|
64c8658c8e | ||
|
|
fea8ce4e5c | ||
|
|
1370c531d2 | ||
|
|
ad9ce1dc10 |
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -7,7 +7,3 @@
|
||||
[submodule "test/test_helper/bats-asser"]
|
||||
path = test/test_helper/bats-assert
|
||||
url = https://github.com/bats-core/bats-assert
|
||||
[submodule ".hooks"]
|
||||
path = .hooks
|
||||
url = https://github.com/natelandau/githooks
|
||||
branch = main
|
||||
|
||||
1
.hooks
1
.hooks
Submodule .hooks deleted from 144f2bb8c4
79
.pre-commit-config.yaml
Normal file
79
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,79 @@
|
||||
---
|
||||
# See https://pre-commit.com for more information
|
||||
# See https://pre-commit.com/hooks.html for more hooks
|
||||
|
||||
default_install_hook_types: [commit-msg, pre-commit]
|
||||
default_stages: [commit, manual]
|
||||
fail_fast: true
|
||||
repos:
|
||||
- repo: "https://github.com/commitizen-tools/commitizen"
|
||||
rev: 3.7.0
|
||||
hooks:
|
||||
- id: commitizen
|
||||
- id: commitizen-branch
|
||||
stages:
|
||||
- post-commit
|
||||
- push
|
||||
- repo: "https://github.com/pre-commit/pre-commit-hooks"
|
||||
rev: v4.4.0
|
||||
hooks:
|
||||
- id: check-added-large-files
|
||||
- id: check-byte-order-marker
|
||||
- id: check-case-conflict
|
||||
- id: check-executables-have-shebangs
|
||||
- id: check-json
|
||||
- id: check-merge-conflict
|
||||
- id: check-shebang-scripts-are-executable
|
||||
exclude: '\.sed$'
|
||||
- id: check-symlinks
|
||||
- id: check-xml
|
||||
- id: check-yaml
|
||||
- id: destroyed-symlinks
|
||||
- id: detect-aws-credentials
|
||||
- id: detect-private-key
|
||||
- id: end-of-file-fixer
|
||||
- id: fix-byte-order-marker
|
||||
- id: mixed-line-ending
|
||||
- id: trailing-whitespace
|
||||
|
||||
- repo: "https://github.com/adrienverge/yamllint.git"
|
||||
rev: v1.32.0
|
||||
hooks:
|
||||
- id: yamllint
|
||||
files: \.(yaml|yml)$
|
||||
entry: yamllint --strict --config-file .yamllint.yml
|
||||
|
||||
- repo: "https://github.com/crate-ci/typos"
|
||||
rev: v1.16.8
|
||||
hooks:
|
||||
- id: typos
|
||||
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: poetry-check
|
||||
name: poetry check
|
||||
entry: poetry check
|
||||
language: system
|
||||
files: pyproject.toml
|
||||
pass_filenames: false
|
||||
|
||||
- id: stopwords
|
||||
name: stopwords
|
||||
entry: bash -c '~/bin/git-stopwords ${PWD}/"$@"'
|
||||
language: system
|
||||
pass_filenames: true
|
||||
|
||||
- id: bats
|
||||
name: bats
|
||||
language: system
|
||||
files: '^test/.*\.bats$'
|
||||
types_or: [shell, bash, sh, zsh]
|
||||
entry: bash -c 'find test/ -maxdepth 1 -name "*.bats" -print0 | xargs -0 -n1 bats -t'
|
||||
pass_filenames: false
|
||||
|
||||
- id: shellcheck
|
||||
name: shellcheck
|
||||
entry: shellcheck
|
||||
language: system
|
||||
types: [shell, bash, sh]
|
||||
exclude: '^archive/.*|.*\.bats'
|
||||
10
.shellcheckrc
Normal file
10
.shellcheckrc
Normal file
@@ -0,0 +1,10 @@
|
||||
# Allow opening any 'source'd file, even if not specified as input
|
||||
external-sources=true
|
||||
|
||||
# Specify the shell to use
|
||||
shell=bash
|
||||
|
||||
disable=SC2236 # Allow [ ! -z foo ] instead of suggesting -n
|
||||
disable=SC2001 # Allow string="string" ; echo "$string" | sed -e "s/ir/ri/"
|
||||
disable=SC2317 # Allow Command appears to be unreachable
|
||||
disable=SC2034 # Allow unused variables
|
||||
9
.typos.toml
Normal file
9
.typos.toml
Normal file
@@ -0,0 +1,9 @@
|
||||
[default]
|
||||
default.locale = "en_us"
|
||||
|
||||
[default.extend-words]
|
||||
curren = "curren" # Used in the context of '¤100'
|
||||
nd = "nd" # Used in the context of '2nd'
|
||||
|
||||
[files]
|
||||
extend-exclude = ["test/test_helper"]
|
||||
34
.yamllint.yml
Normal file
34
.yamllint.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
# Find full documentation at: https://yamllint.readthedocs.io/en/stable/index.html
|
||||
extends: default
|
||||
locale: en_US.UTF-8
|
||||
|
||||
ignore: |
|
||||
.venv
|
||||
test/test_helper
|
||||
|
||||
rules:
|
||||
braces:
|
||||
level: error
|
||||
max-spaces-inside: 1
|
||||
min-spaces-inside: 1
|
||||
comments-indentation: disable
|
||||
comments:
|
||||
min-spaces-from-content: 1
|
||||
indentation:
|
||||
spaces: consistent
|
||||
indent-sequences: true
|
||||
check-multi-line-strings: false
|
||||
line-length: disable
|
||||
quoted-strings:
|
||||
quote-type: any
|
||||
required: false
|
||||
extra-required:
|
||||
- "^http://"
|
||||
- "^https://"
|
||||
- "ftp://"
|
||||
- 'ssh \w.*'
|
||||
extra-allowed: []
|
||||
truthy:
|
||||
level: error
|
||||
check-keys: false
|
||||
288
README.md
288
README.md
@@ -20,28 +20,28 @@ To create a new script, copy one of the script templates to a new file and make
|
||||
|
||||
There are two templates located at the root level of this repository.
|
||||
|
||||
- **`template.sh`** - A lean template which attempts to source all the utility functions from this repository. You will need to update the path to the utilities folder sent to `_sourceUtilities_` at the bottom of the script. This template will not function correctly if the utilities are not found.
|
||||
- **`template_standalone.sh`** - For portability, the standalone template does not assume that this repository is available. Copy and paste the individual utility functions under the `### Custom utility functions` line.
|
||||
- **`template.sh`** - A lean template which attempts to source all the utility functions from this repository. You will need to update the path to the utilities folder sent to `_sourceUtilities_` at the bottom of the script. This template will not function correctly if the utilities are not found.
|
||||
- **`template_standalone.sh`** - For portability, the standalone template does not assume that this repository is available. Copy and paste the individual utility functions under the `### Custom utility functions` line.
|
||||
|
||||
### Code Organization
|
||||
|
||||
The script templates are roughly split into three sections:
|
||||
|
||||
- TOP: Write the main logic of your script within the `_mainScript_` function. It is placed at the top of the file for easy access and editing. However, it is invoked at the end of the script after options are parsed and functions are sourced.
|
||||
- MIDDLE: Functions and default variable settings are located just below `_mainScript_`.
|
||||
- BOTTOM: Script initialization (BASH options, traps, call to `_mainScript_`, etc.) is at the bottom of the template
|
||||
- TOP: Write the main logic of your script within the `_mainScript_` function. It is placed at the top of the file for easy access and editing. However, it is invoked at the end of the script after options are parsed and functions are sourced.
|
||||
- MIDDLE: Functions and default variable settings are located just below `_mainScript_`.
|
||||
- BOTTOM: Script initialization (BASH options, traps, call to `_mainScript_`, etc.) is at the bottom of the template
|
||||
|
||||
### Default Options
|
||||
|
||||
These default options and global variables are included in the templates and used throughout the utility functions. CLI flags to set/unset them are:
|
||||
|
||||
- **`-h, --help`**: Prints the contents of the `_usage_` function. Edit the text in that function to provide help
|
||||
- **`--logfile [FILE]`** Full PATH to logfile. (Default is `${HOME}/logs/$(basename "$0").log`)
|
||||
- **`loglevel [LEVEL]`**: Log level of the script. One of: `FATAL`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `ALL`, `OFF` (Default is '`ERROR`')
|
||||
- **`-n, --dryrun`**: Dryrun, sets `$DRYRUN` to `true` allowing you to write functions that will work non-destructively using the `_execute_` function
|
||||
- **`-q, --quiet`**: Runs in quiet mode, suppressing all output to stdout. Will still write to log files
|
||||
- **`-v, --verbose`**: Sets `$VERBOSE` to `true` and prints all debug messages to stdout
|
||||
- **`--force`**: If using the `_seekConfirmation_` utility function, this skips all user interaction. Implied `Yes` to all confirmations.
|
||||
- **`-h, --help`**: Prints the contents of the `_usage_` function. Edit the text in that function to provide help
|
||||
- **`--logfile [FILE]`** Full PATH to logfile. (Default is `${HOME}/logs/$(basename "$0").log`)
|
||||
- **`loglevel [LEVEL]`**: Log level of the script. One of: `FATAL`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `ALL`, `OFF` (Default is '`ERROR`')
|
||||
- **`-n, --dryrun`**: Dryrun, sets `$DRYRUN` to `true` allowing you to write functions that will work non-destructively using the `_execute_` function
|
||||
- **`-q, --quiet`**: Runs in quiet mode, suppressing all output to stdout. Will still write to log files
|
||||
- **`-v, --verbose`**: Sets `$VERBOSE` to `true` and prints all debug messages to stdout
|
||||
- **`--force`**: If using the `_seekConfirmation_` utility function, this skips all user interaction. Implied `Yes` to all confirmations.
|
||||
|
||||
You can add custom script options and flags to the `_parseOptions_` function.
|
||||
|
||||
@@ -125,11 +125,11 @@ You can copy any complete function from the Utilities and place it into your scr
|
||||
|
||||
## alerts.bash
|
||||
|
||||
- **`_columns_`** Prints a two column output from a key/value pair
|
||||
- -**`_printFuncStack_`** Prints the function stack in use. Used for debugging, and error reporting
|
||||
- **`_alert_`** Performs alerting functions including writing to a log file and printing to screen
|
||||
- **`_centerOutput_`** Prints text in the center of the terminal window
|
||||
- **`_setColors_`** Sets color constants for alerting (**Note:** Colors default to a dark theme.)
|
||||
- **`_columns_`** Prints a two column output from a key/value pair
|
||||
- -**`_printFuncStack_`** Prints the function stack in use. Used for debugging, and error reporting
|
||||
- **`_alert_`** Performs alerting functions including writing to a log file and printing to screen
|
||||
- **`_centerOutput_`** Prints text in the center of the terminal window
|
||||
- **`_setColors_`** Sets color constants for alerting (**Note:** Colors default to a dark theme.)
|
||||
|
||||
Basic alerting, logging, and setting color functions (included in `scriptTemplate.sh` by default). Print messages to stdout and to a user specified logfile using the following functions.
|
||||
|
||||
@@ -147,180 +147,202 @@ dryrun "some text" # Prints commands that would be run if not in dry run (-n)
|
||||
|
||||
The following global variables must be set for the alert functions to work
|
||||
|
||||
- **`$DEBUG`** - If `true`, prints `debug` level alerts to stdout. (Default: `false`)
|
||||
- **`$DRYRUN`** - If `true` does not eval commands passed to `_execute_` function. (Default: `false`)
|
||||
- **`$LOGFILE`** - Path to a log file
|
||||
- **`$LOGLEVEL`** - One of: FATAL, ERROR, WARN, INFO, DEBUG, ALL, OFF (Default: `ERROR`)
|
||||
- **`$QUIET`** - If `true`, prints to log file but not stdout. (Default: `false`)
|
||||
- **`$DEBUG`** - If `true`, prints `debug` level alerts to stdout. (Default: `false`)
|
||||
- **`$DRYRUN`** - If `true` does not eval commands passed to `_execute_` function. (Default: `false`)
|
||||
- **`$LOGFILE`** - Path to a log file
|
||||
- **`$LOGLEVEL`** - One of: FATAL, ERROR, WARN, INFO, DEBUG, ALL, OFF (Default: `ERROR`)
|
||||
- **`$QUIET`** - If `true`, prints to log file but not stdout. (Default: `false`)
|
||||
|
||||
## arrays.bash
|
||||
|
||||
Utility functions for working with arrays.
|
||||
|
||||
- **`_dedupeArray_`** Removes duplicate array elements
|
||||
- **`_forEachDo_`** Iterates over elements and passes each to a function
|
||||
- **`_forEachFilter_`** Iterates over elements, returning only those that are validated by a function
|
||||
- **`_forEachFind_`** Iterates over elements, returning the first value that is validated by a function
|
||||
- **`_forEachReject_`** Iterates over elements, returning only those that are NOT validated by a function
|
||||
- **`_forEachValidate_`** Iterates over elements and passes each to a function for validation
|
||||
- **`_inArray_`** Determine if a value is in an array
|
||||
- **`_isEmptyArray_`** Checks if an array is empty
|
||||
- **`_joinArray_`** Joins items together with a user specified separator
|
||||
- **`_mergeArrays_`** Merges the values of two arrays together
|
||||
- **`_randomArrayElement_`** Selects a random item from an array
|
||||
- **`_reverseSortArray_`** Sorts an array from highest to lowest
|
||||
- **`_setdiff_`** Return items that exist in ARRAY1 that are do not exist in ARRAY2
|
||||
- **`_sortArray_`** Sorts an array from lowest to highest
|
||||
- **`_dedupeArray_`** Removes duplicate array elements
|
||||
- **`_forEachDo_`** Iterates over elements and passes each to a function
|
||||
- **`_forEachFilter_`** Iterates over elements, returning only those that are validated by a function
|
||||
- **`_forEachFind_`** Iterates over elements, returning the first value that is validated by a function
|
||||
- **`_forEachReject_`** Iterates over elements, returning only those that are NOT validated by a function
|
||||
- **`_forEachValidate_`** Iterates over elements and passes each to a function for validation
|
||||
- **`_inArray_`** Determine if a value is in an array
|
||||
- **`_isEmptyArray_`** Checks if an array is empty
|
||||
- **`_joinArray_`** Joins items together with a user specified separator
|
||||
- **`_mergeArrays_`** Merges the values of two arrays together
|
||||
- **`_randomArrayElement_`** Selects a random item from an array
|
||||
- **`_reverseSortArray_`** Sorts an array from highest to lowest
|
||||
- **`_setdiff_`** Return items that exist in ARRAY1 that are do not exist in ARRAY2
|
||||
- **`_sortArray_`** Sorts an array from lowest to highest
|
||||
|
||||
## checks.bash
|
||||
|
||||
Functions for validating common use-cases
|
||||
|
||||
- **`_commandExists_`** Check if a command or binary exists in the PATH
|
||||
- **`_functionExists_`** Tests if a function is available in current scope
|
||||
- **`_isInternetAvailable_`** Checks if Internet connections are possible
|
||||
- **`_isAlpha_`** Validate that a given variable contains only alphabetic characters
|
||||
- **`_isAlphaDash_`** Validate that a given variable contains only alpha-numeric characters, as well as dashes and underscores
|
||||
- **`_isAlphaNum_`** Validate that a given variable contains only alpha-numeric characters
|
||||
- **`_isDir_`** Validate that a given input points to a valid directory
|
||||
- **`_isEmail_`** Validates that an input is a valid email address
|
||||
- **`_isFQDN_`** Determines if a given input is a fully qualified domain name
|
||||
- **`_isFile_`** Validate that a given input points to a valid file
|
||||
- **`_isIPv4_`** Validates that an input is a valid IPv4 address
|
||||
- **`_isIPv6_`** Validates that an input is a valid IPv6 address
|
||||
- **`_isNum_`** Validate that a given variable contains only numeric characters
|
||||
- **`_isTerminal_`** Checks if script is run in an interactive terminal
|
||||
- **`_rootAvailable_`** Validate we have superuser access as root (via sudo if requested)
|
||||
- **`_varIsEmpty_`** Checks if a given variable is empty or null
|
||||
- **`_varIsFalse_`** Checks if a given variable is false
|
||||
- **`_varIsTrue_`** Checks if a given variable is true
|
||||
- **`_commandExists_`** Check if a command or binary exists in the PATH
|
||||
- **`_functionExists_`** Tests if a function is available in current scope
|
||||
- **`_isInternetAvailable_`** Checks if Internet connections are possible
|
||||
- **`_isAlpha_`** Validate that a given variable contains only alphabetic characters
|
||||
- **`_isAlphaDash_`** Validate that a given variable contains only alpha-numeric characters, as well as dashes and underscores
|
||||
- **`_isAlphaNum_`** Validate that a given variable contains only alpha-numeric characters
|
||||
- **`_isDir_`** Validate that a given input points to a valid directory
|
||||
- **`_isEmail_`** Validates that an input is a valid email address
|
||||
- **`_isFQDN_`** Determines if a given input is a fully qualified domain name
|
||||
- **`_isFile_`** Validate that a given input points to a valid file
|
||||
- **`_isIPv4_`** Validates that an input is a valid IPv4 address
|
||||
- **`_isIPv6_`** Validates that an input is a valid IPv6 address
|
||||
- **`_isNum_`** Validate that a given variable contains only numeric characters
|
||||
- **`_isTerminal_`** Checks if script is run in an interactive terminal
|
||||
- **`_rootAvailable_`** Validate we have superuser access as root (via sudo if requested)
|
||||
- **`_varIsEmpty_`** Checks if a given variable is empty or null
|
||||
- **`_varIsFalse_`** Checks if a given variable is false
|
||||
- **`_varIsTrue_`** Checks if a given variable is true
|
||||
|
||||
## dates.bash
|
||||
|
||||
Functions for working with dates and time.
|
||||
|
||||
- **`_convertToUnixTimestamp_`** Converts a date to unix timestamp
|
||||
- **`_countdown_`** Sleep for a specified amount of time
|
||||
- **`_dateUnixTimestamp_`** Current time in unix timestamp
|
||||
- **`_formatDate_`** Reformats dates into user specified formats
|
||||
- **`_fromSeconds_`** Convert seconds to HH:MM:SS
|
||||
- **`_monthToNumber_`** Convert a month name to a number
|
||||
- **`_numberToMonth_`** Convert a month number to its name
|
||||
- **`_parseDate_`** Takes a string as input and attempts to find a date within it to parse into component parts (day, month, year)
|
||||
- **`_readableUnixTimestamp_`** Format unix timestamp to human readable format
|
||||
- **`_toSeconds_`** Converts HH:MM:SS to seconds
|
||||
- **`_convertToUnixTimestamp_`** Converts a date to unix timestamp
|
||||
- **`_countdown_`** Sleep for a specified amount of time
|
||||
- **`_dateUnixTimestamp_`** Current time in unix timestamp
|
||||
- **`_formatDate_`** Reformats dates into user specified formats
|
||||
- **`_fromSeconds_`** Convert seconds to HH:MM:SS
|
||||
- **`_monthToNumber_`** Convert a month name to a number
|
||||
- **`_numberToMonth_`** Convert a month number to its name
|
||||
- **`_parseDate_`** Takes a string as input and attempts to find a date within it to parse into component parts (day, month, year)
|
||||
- **`_readableUnixTimestamp_`** Format unix timestamp to human readable format
|
||||
- **`_toSeconds_`** Converts HH:MM:SS to seconds
|
||||
|
||||
## debug.bash
|
||||
|
||||
Functions to aid in debugging BASH scripts
|
||||
|
||||
- **`_pauseScript_`** Pause a script at any point and continue after user input
|
||||
- **`_printAnsi_`** Helps debug ansi escape sequence in text by displaying the escape codes
|
||||
- **`_printArray_`** Prints the content of array as key value pairs for easier debugging
|
||||
- **`_pauseScript_`** Pause a script at any point and continue after user input
|
||||
- **`_printAnsi_`** Helps debug ansi escape sequence in text by displaying the escape codes
|
||||
- **`_printArray_`** Prints the content of array as key value pairs for easier debugging
|
||||
|
||||
## files.bash
|
||||
|
||||
Functions for working with files.
|
||||
|
||||
- **`_backupFile_`** Creates a backup of a specified file with .bak extension or optionally to a specified directory.
|
||||
- **`_decryptFile_`** Decrypts a file with `openssl`
|
||||
- **`_encryptFile_`** Encrypts a file with `openssl`
|
||||
- **`_extractArchive_`** Extract a compressed file
|
||||
- **`_fileBasename_`** Gets the basename of a file from a file name
|
||||
- **`_fileContains_`** Tests whether a file contains a given pattern
|
||||
- **`_filePath_`** Gets the absolute path to a file
|
||||
- **`_fileExtension_`** Gets the extension of a file
|
||||
- **`_fileName_`** Prints a filename from a path
|
||||
- **`_json2yaml_`** Convert JSON to YAML uses python
|
||||
- **`_listFiles_`** Find files in a directory. Use either glob or regex.
|
||||
- **`_makeSymlink_`** Creates a symlink and backs up a file which may be overwritten by the new symlink. If the exact same symlink already exists, nothing is done.
|
||||
- **`_parseYAML_`** Convert a YAML file into BASH variables for use in a shell script
|
||||
- **`_printFileBetween_`** Prints block of text in a file between two regex patterns
|
||||
- **`_readFile_`** Prints each line of a file
|
||||
- **`_sourceFile_`** Source a file into a script
|
||||
- **`_createUniqueFilename_`** Ensure a file to be created has a unique filename to avoid overwriting other files
|
||||
- **`_yaml2json_`** Convert a YAML file to JSON with python
|
||||
- **`_backupFile_`** Creates a backup of a specified file with .bak extension or optionally to a specified directory.
|
||||
- **`_decryptFile_`** Decrypts a file with `openssl`
|
||||
- **`_encryptFile_`** Encrypts a file with `openssl`
|
||||
- **`_extractArchive_`** Extract a compressed file
|
||||
- **`_fileBasename_`** Gets the basename of a file from a file name
|
||||
- **`_fileContains_`** Tests whether a file contains a given pattern
|
||||
- **`_filePath_`** Gets the absolute path to a file
|
||||
- **`_fileExtension_`** Gets the extension of a file
|
||||
- **`_fileName_`** Prints a filename from a path
|
||||
- **`_json2yaml_`** Convert JSON to YAML uses python
|
||||
- **`_listFiles_`** Find files in a directory. Use either glob or regex.
|
||||
- **`_makeSymlink_`** Creates a symlink and backs up a file which may be overwritten by the new symlink. If the exact same symlink already exists, nothing is done.
|
||||
- **`_parseYAML_`** Convert a YAML file into BASH variables for use in a shell script
|
||||
- **`_printFileBetween_`** Prints block of text in a file between two regex patterns
|
||||
- **`_randomLineFromFile_`** Prints a random line from a file
|
||||
- **`_readFile_`** Prints each line of a file
|
||||
- **`_sourceFile_`** Source a file into a script
|
||||
- **`_createUniqueFilename_`** Ensure a file to be created has a unique filename to avoid overwriting other files
|
||||
- **`_yaml2json_`** Convert a YAML file to JSON with python
|
||||
|
||||
## macOS.bash
|
||||
|
||||
Functions useful when writing scripts to be run on macOS
|
||||
|
||||
- **`_guiInput_`** Ask for user input using a Mac dialog box
|
||||
- **`_haveScriptableFinder_`** Determine whether we can script the Finder or not
|
||||
- **`_homebrewPath_`** Adds Homebrew bin directory to PATH
|
||||
- **`_useGNUUtils_`** Add GNU utilities to PATH to allow consistent use of sed/grep/tar/etc. on MacOS
|
||||
- **`_guiInput_`** Ask for user input using a Mac dialog box
|
||||
- **`_haveScriptableFinder_`** Determine whether we can script the Finder or not
|
||||
- **`_homebrewPath_`** Adds Homebrew bin directory to PATH
|
||||
- **`_useGNUUtils_`** Add GNU utilities to PATH to allow consistent use of sed/grep/tar/etc. on MacOS
|
||||
|
||||
## misc.bash
|
||||
|
||||
Miscellaneous functions
|
||||
|
||||
- **`_acquireScriptLock_`** Acquire script lock to prevent running the same script a second time before the first instance exits
|
||||
- **`_detectLinuxDistro_`** Detects the host computer's distribution of Linux
|
||||
- **`_detectMacOSVersion_`** Detects the host computer's version of macOS
|
||||
- **`_detectOS_`** Detect the the host computer's operating system
|
||||
- **`_endspin_`** Clears output from the _spinner_
|
||||
- **`_execute_`** Executes commands with safety and logging options. Respects `DRYRUN` and `VERBOSE` flags.
|
||||
- **`_findBaseDir_`** Locates the real directory of the script being run. Similar to GNU readlink -n
|
||||
- **`_generateUUID_`** Generates a unique UUID
|
||||
- **`_progressBar_`** Prints a progress bar within a for/while loop
|
||||
- **`_runAsRoot_`** Run the requested command as root (via sudo if requested)
|
||||
- **`_seekConfirmation_`** Seek user input for yes/no question
|
||||
- **`_spinner_`** Creates a spinner within a for/while loop.
|
||||
- **`_trapCleanup_`** Cleans up after a trapped error.
|
||||
- **`_acquireScriptLock_`** Acquire script lock to prevent running the same script a second time before the first instance exits
|
||||
- **`_detectLinuxDistro_`** Detects the host computer's distribution of Linux
|
||||
- **`_detectMacOSVersion_`** Detects the host computer's version of macOS
|
||||
- **`_detectOS_`** Detect the the host computer's operating system
|
||||
- **`_endspin_`** Clears output from the _spinner_
|
||||
- **`_execute_`** Executes commands with safety and logging options. Respects `DRYRUN` and `VERBOSE` flags.
|
||||
- **`_findBaseDir_`** Locates the real directory of the script being run. Similar to GNU readlink -n
|
||||
- **`_generateUUID_`** Generates a unique UUID
|
||||
- **`_progressBar_`** Prints a progress bar within a for/while loop
|
||||
- **`_runAsRoot_`** Run the requested command as root (via sudo if requested)
|
||||
- **`_seekConfirmation_`** Seek user input for yes/no question
|
||||
- **`_spinner_`** Creates a spinner within a for/while loop.
|
||||
- **`_trapCleanup_`** Cleans up after a trapped error.
|
||||
|
||||
## services.bash
|
||||
|
||||
Functions to work with external services
|
||||
|
||||
- **`_haveInternet_`** Tests to see if there is an active Internet connection
|
||||
- **`_httpStatus_`** Report the HTTP status of a specified URL
|
||||
- **`_pushover_`** Sends a notification via Pushover (Requires API keys)
|
||||
- **`_haveInternet_`** Tests to see if there is an active Internet connection
|
||||
- **`_httpStatus_`** Report the HTTP status of a specified URL
|
||||
- **`_pushover_`** Sends a notification via Pushover (Requires API keys)
|
||||
|
||||
## strings.bash
|
||||
|
||||
Functions for string manipulation
|
||||
|
||||
- **`_cleanString_`** Cleans a string of text
|
||||
- **`_decodeHTML_`** Decode HTML characters with sed. (Requires sed file)
|
||||
- **`_decodeURL_`** Decode a URL encoded string
|
||||
- **`_encodeHTML_`** Encode HTML characters with sed (Requires sed file)
|
||||
- **`_encodeURL_`** URL encode a string
|
||||
- **`_escapeString_`** Escapes a string by adding `\` before special chars
|
||||
- **`_lower_`** Convert a string to lowercase
|
||||
- **`_ltrim_`** Removes all leading whitespace (from the left)
|
||||
- **`_regexCapture_`** Use regex to validate and parse strings
|
||||
- **`_rtrim_`** Removes all leading whitespace (from the right)
|
||||
- **`_splitString_`** Split a string based on a given delimeter
|
||||
- **`_stringContains_`** Tests whether a string matches a substring
|
||||
- **`_stringRegex_`** Tests whether a string matches a regex pattern
|
||||
- **`_stripANSI_`** Strips ANSI escape sequences from text
|
||||
- **`_stripStopwords_`** Removes common stopwords from a string using a list of sed replacements located in an external file.
|
||||
- **`_trim_`** Removes all leading/trailing whitespace
|
||||
- **`_upper_`** Convert a string to uppercase
|
||||
- **`_cleanString_`** Cleans a string of text
|
||||
- **`_decodeHTML_`** Decode HTML characters with sed. (Requires sed file)
|
||||
- **`_decodeURL_`** Decode a URL encoded string
|
||||
- **`_encodeHTML_`** Encode HTML characters with sed (Requires sed file)
|
||||
- **`_encodeURL_`** URL encode a string
|
||||
- **`_escapeString_`** Escapes a string by adding `\` before special chars
|
||||
- **`_lower_`** Convert a string to lowercase
|
||||
- **`_ltrim_`** Removes all leading whitespace (from the left)
|
||||
- **`_regexCapture_`** Use regex to validate and parse strings
|
||||
- **`_rtrim_`** Removes all leading whitespace (from the right)
|
||||
- **`_splitString_`** Split a string based on a given delimiter
|
||||
- **`_stringContains_`** Tests whether a string matches a substring
|
||||
- **`_stringRegex_`** Tests whether a string matches a regex pattern
|
||||
- **`_stripANSI_`** Strips ANSI escape sequences from text
|
||||
- **`_stripStopwords_`** Removes common stopwords from a string using a list of sed replacements located in an external file.
|
||||
- **`_trim_`** Removes all leading/trailing whitespace
|
||||
- **`_upper_`** Convert a string to uppercase
|
||||
|
||||
## template_utils.bash
|
||||
|
||||
Functions required to allow the script template and alert functions to be used
|
||||
|
||||
- **`_makeTempDir_`** Creates a temp directory to house temporary files
|
||||
- **`_safeExit_`** Cleans up temporary files before exiting a script
|
||||
- **`_setPATH_`** Add directories to $PATH so script can find executables
|
||||
- **`_makeTempDir_`** Creates a temp directory to house temporary files
|
||||
- **`_safeExit_`** Cleans up temporary files before exiting a script
|
||||
- **`_setPATH_`** Add directories to $PATH so script can find executables
|
||||
|
||||
# Coding conventions
|
||||
|
||||
- Function names use camel case surrounded by underscores: `_nameOfFunction_`
|
||||
- Local variable names use camel case with a starting underscore: `_localVariable`
|
||||
- Global variables are in ALL_CAPS with underscores seperating words
|
||||
- Exceptions to the variable an function naming rules are made for alerting functions and colors to ease my speed of programming. (Breaking years of habits is hard...) I.e. `notice "Some log item: ${blue}blue text${reset}` Where `notice` is a function and `$blue` and `$reset` are global variables but are lowercase.
|
||||
- Variables are always surrounded by quotes and brackets `"${1}"` (Overly verbose true, but a safe practice)
|
||||
- Formatting is provided by [shfmt](https://github.com/mvdan/sh) using 4 spaces for indentation
|
||||
- All scripts and functions are fully [Shellcheck](https://github.com/koalaman/shellcheck) compliant
|
||||
- Where possible, I follow [defensive BASH programming](https://kfirlavi.herokuapp.com/blog/2012/11/14/defensive-bash-programming/) principles.
|
||||
- Function names use camel case surrounded by underscores: `_nameOfFunction_`
|
||||
- Local variable names use camel case with a starting underscore: `_localVariable`
|
||||
- Global variables are in ALL_CAPS with underscores separating words
|
||||
- Exceptions to the variable an function naming rules are made for alerting functions and colors to ease my speed of programming. (Breaking years of habits is hard...) I.e. `notice "Some log item: ${blue}blue text${reset}` Where `notice` is a function and `$blue` and `$reset` are global variables but are lowercase.
|
||||
- Variables are always surrounded by quotes and brackets `"${1}"` (Overly verbose true, but a safe practice)
|
||||
- Formatting is provided by [shfmt](https://github.com/mvdan/sh) using 4 spaces for indentation
|
||||
- All scripts and functions are fully [Shellcheck](https://github.com/koalaman/shellcheck) compliant
|
||||
- Where possible, I follow [defensive BASH programming](https://kfirlavi.herokuapp.com/blog/2012/11/14/defensive-bash-programming/) principles.
|
||||
|
||||
## A Note on Code Reuse and Prior Art
|
||||
|
||||
I compiled these scripting utilities over many years without having an intention to make them public. As a novice programmer, I have Googled, GitHubbed, and StackExchanged a path to solve my own scripting needs. I often lift a function whole-cloth from a GitHub repo don't keep track of its original location. I have done my best within these files to recreate my footsteps and give credit to the original creators of the code when possible. Unfortunately, I fear that I missed as many as I found. My goal in making this repository public is not to take credit for the code written by others. If you recognize something that I didn't credit, please let me know.
|
||||
|
||||
## Contributing
|
||||
|
||||
### Setup
|
||||
|
||||
1. Install Python 3.11 and [Poetry](https://python-poetry.org)
|
||||
2. Clone this repository. `git clone https://github.com/natelandau/shell-scripting-templates.git`
|
||||
3. Install the Poetry environment with `poetry install`.
|
||||
4. Activate your Poetry environment with `poetry shell`.
|
||||
5. Install the pre-commit hooks with `pre-commit install --install-hooks`.
|
||||
|
||||
### Developing
|
||||
|
||||
- Activate your Poetry environment with `poetry shell`.
|
||||
- This project follows the [Conventional Commits](https://www.conventionalcommits.org/) standard to automate [Semantic Versioning](https://semver.org/) and [Keep A Changelog](https://keepachangelog.com/) with [Commitizen](https://github.com/commitizen-tools/commitizen).
|
||||
- When you're ready to commit changes run `cz c`
|
||||
- Run `poe` from within the development environment to print a list of [Poe the Poet](https://github.com/nat-n/poethepoet) tasks available to run on this project. Common commands:
|
||||
- `poe lint` runs all linters and tests
|
||||
- Run `poetry add {package}` from within the development environment to install a runtime dependency and add it to `pyproject.toml` and `poetry.lock`.
|
||||
- Run `poetry remove {package}` from within the development environment to uninstall a runtime dependency and remove it from `pyproject.toml` and `poetry.lock`.
|
||||
- Run `poetry update` from within the development environment to upgrade all dependencies to the latest versions allowed by `pyproject.toml`.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
640
poetry.lock
generated
Normal file
640
poetry.lock
generated
Normal file
@@ -0,0 +1,640 @@
|
||||
# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand.
|
||||
|
||||
[[package]]
|
||||
name = "argcomplete"
|
||||
version = "3.1.1"
|
||||
description = "Bash tab completion for argparse"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
files = [
|
||||
{file = "argcomplete-3.1.1-py3-none-any.whl", hash = "sha256:35fa893a88deea85ea7b20d241100e64516d6af6d7b0ae2bed1d263d26f70948"},
|
||||
{file = "argcomplete-3.1.1.tar.gz", hash = "sha256:6c4c563f14f01440aaffa3eae13441c5db2357b5eec639abe7c0b15334627dff"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
test = ["coverage", "mypy", "pexpect", "ruff", "wheel"]
|
||||
|
||||
[[package]]
|
||||
name = "cfgv"
|
||||
version = "3.4.0"
|
||||
description = "Validate configuration and produce human readable error messages."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
files = [
|
||||
{file = "cfgv-3.4.0-py2.py3-none-any.whl", hash = "sha256:b7265b1f29fd3316bfcd2b330d63d024f2bfd8bcb8b0272f8e19a504856c48f9"},
|
||||
{file = "cfgv-3.4.0.tar.gz", hash = "sha256:e52591d4c5f5dead8e0f673fb16db7949d2cfb3f7da4582893288f0ded8fe560"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "charset-normalizer"
|
||||
version = "3.2.0"
|
||||
description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7.0"
|
||||
files = [
|
||||
{file = "charset-normalizer-3.2.0.tar.gz", hash = "sha256:3bb3d25a8e6c0aedd251753a79ae98a093c7e7b471faa3aa9a93a81431987ace"},
|
||||
{file = "charset_normalizer-3.2.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:0b87549028f680ca955556e3bd57013ab47474c3124dc069faa0b6545b6c9710"},
|
||||
{file = "charset_normalizer-3.2.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7c70087bfee18a42b4040bb9ec1ca15a08242cf5867c58726530bdf3945672ed"},
|
||||
{file = "charset_normalizer-3.2.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a103b3a7069b62f5d4890ae1b8f0597618f628b286b03d4bc9195230b154bfa9"},
|
||||
{file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:94aea8eff76ee6d1cdacb07dd2123a68283cb5569e0250feab1240058f53b623"},
|
||||
{file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:db901e2ac34c931d73054d9797383d0f8009991e723dab15109740a63e7f902a"},
|
||||
{file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b0dac0ff919ba34d4df1b6131f59ce95b08b9065233446be7e459f95554c0dc8"},
|
||||
{file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:193cbc708ea3aca45e7221ae58f0fd63f933753a9bfb498a3b474878f12caaad"},
|
||||
{file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:09393e1b2a9461950b1c9a45d5fd251dc7c6f228acab64da1c9c0165d9c7765c"},
|
||||
{file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:baacc6aee0b2ef6f3d308e197b5d7a81c0e70b06beae1f1fcacffdbd124fe0e3"},
|
||||
{file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:bf420121d4c8dce6b889f0e8e4ec0ca34b7f40186203f06a946fa0276ba54029"},
|
||||
{file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:c04a46716adde8d927adb9457bbe39cf473e1e2c2f5d0a16ceb837e5d841ad4f"},
|
||||
{file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:aaf63899c94de41fe3cf934601b0f7ccb6b428c6e4eeb80da72c58eab077b19a"},
|
||||
{file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d62e51710986674142526ab9f78663ca2b0726066ae26b78b22e0f5e571238dd"},
|
||||
{file = "charset_normalizer-3.2.0-cp310-cp310-win32.whl", hash = "sha256:04e57ab9fbf9607b77f7d057974694b4f6b142da9ed4a199859d9d4d5c63fe96"},
|
||||
{file = "charset_normalizer-3.2.0-cp310-cp310-win_amd64.whl", hash = "sha256:48021783bdf96e3d6de03a6e39a1171ed5bd7e8bb93fc84cc649d11490f87cea"},
|
||||
{file = "charset_normalizer-3.2.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:4957669ef390f0e6719db3613ab3a7631e68424604a7b448f079bee145da6e09"},
|
||||
{file = "charset_normalizer-3.2.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:46fb8c61d794b78ec7134a715a3e564aafc8f6b5e338417cb19fe9f57a5a9bf2"},
|
||||
{file = "charset_normalizer-3.2.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f779d3ad205f108d14e99bb3859aa7dd8e9c68874617c72354d7ecaec2a054ac"},
|
||||
{file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f25c229a6ba38a35ae6e25ca1264621cc25d4d38dca2942a7fce0b67a4efe918"},
|
||||
{file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2efb1bd13885392adfda4614c33d3b68dee4921fd0ac1d3988f8cbb7d589e72a"},
|
||||
{file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1f30b48dd7fa1474554b0b0f3fdfdd4c13b5c737a3c6284d3cdc424ec0ffff3a"},
|
||||
{file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:246de67b99b6851627d945db38147d1b209a899311b1305dd84916f2b88526c6"},
|
||||
{file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9bd9b3b31adcb054116447ea22caa61a285d92e94d710aa5ec97992ff5eb7cf3"},
|
||||
{file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:8c2f5e83493748286002f9369f3e6607c565a6a90425a3a1fef5ae32a36d749d"},
|
||||
{file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:3170c9399da12c9dc66366e9d14da8bf7147e1e9d9ea566067bbce7bb74bd9c2"},
|
||||
{file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:7a4826ad2bd6b07ca615c74ab91f32f6c96d08f6fcc3902ceeedaec8cdc3bcd6"},
|
||||
{file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:3b1613dd5aee995ec6d4c69f00378bbd07614702a315a2cf6c1d21461fe17c23"},
|
||||
{file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9e608aafdb55eb9f255034709e20d5a83b6d60c054df0802fa9c9883d0a937aa"},
|
||||
{file = "charset_normalizer-3.2.0-cp311-cp311-win32.whl", hash = "sha256:f2a1d0fd4242bd8643ce6f98927cf9c04540af6efa92323e9d3124f57727bfc1"},
|
||||
{file = "charset_normalizer-3.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:681eb3d7e02e3c3655d1b16059fbfb605ac464c834a0c629048a30fad2b27489"},
|
||||
{file = "charset_normalizer-3.2.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c57921cda3a80d0f2b8aec7e25c8aa14479ea92b5b51b6876d975d925a2ea346"},
|
||||
{file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:41b25eaa7d15909cf3ac4c96088c1f266a9a93ec44f87f1d13d4a0e86c81b982"},
|
||||
{file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f058f6963fd82eb143c692cecdc89e075fa0828db2e5b291070485390b2f1c9c"},
|
||||
{file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a7647ebdfb9682b7bb97e2a5e7cb6ae735b1c25008a70b906aecca294ee96cf4"},
|
||||
{file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eef9df1eefada2c09a5e7a40991b9fc6ac6ef20b1372abd48d2794a316dc0449"},
|
||||
{file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e03b8895a6990c9ab2cdcd0f2fe44088ca1c65ae592b8f795c3294af00a461c3"},
|
||||
{file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:ee4006268ed33370957f55bf2e6f4d263eaf4dc3cfc473d1d90baff6ed36ce4a"},
|
||||
{file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c4983bf937209c57240cff65906b18bb35e64ae872da6a0db937d7b4af845dd7"},
|
||||
{file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:3bb7fda7260735efe66d5107fb7e6af6a7c04c7fce9b2514e04b7a74b06bf5dd"},
|
||||
{file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:72814c01533f51d68702802d74f77ea026b5ec52793c791e2da806a3844a46c3"},
|
||||
{file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:70c610f6cbe4b9fce272c407dd9d07e33e6bf7b4aa1b7ffb6f6ded8e634e3592"},
|
||||
{file = "charset_normalizer-3.2.0-cp37-cp37m-win32.whl", hash = "sha256:a401b4598e5d3f4a9a811f3daf42ee2291790c7f9d74b18d75d6e21dda98a1a1"},
|
||||
{file = "charset_normalizer-3.2.0-cp37-cp37m-win_amd64.whl", hash = "sha256:c0b21078a4b56965e2b12f247467b234734491897e99c1d51cee628da9786959"},
|
||||
{file = "charset_normalizer-3.2.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:95eb302ff792e12aba9a8b8f8474ab229a83c103d74a750ec0bd1c1eea32e669"},
|
||||
{file = "charset_normalizer-3.2.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1a100c6d595a7f316f1b6f01d20815d916e75ff98c27a01ae817439ea7726329"},
|
||||
{file = "charset_normalizer-3.2.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:6339d047dab2780cc6220f46306628e04d9750f02f983ddb37439ca47ced7149"},
|
||||
{file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e4b749b9cc6ee664a3300bb3a273c1ca8068c46be705b6c31cf5d276f8628a94"},
|
||||
{file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a38856a971c602f98472050165cea2cdc97709240373041b69030be15047691f"},
|
||||
{file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f87f746ee241d30d6ed93969de31e5ffd09a2961a051e60ae6bddde9ec3583aa"},
|
||||
{file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:89f1b185a01fe560bc8ae5f619e924407efca2191b56ce749ec84982fc59a32a"},
|
||||
{file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e1c8a2f4c69e08e89632defbfabec2feb8a8d99edc9f89ce33c4b9e36ab63037"},
|
||||
{file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:2f4ac36d8e2b4cc1aa71df3dd84ff8efbe3bfb97ac41242fbcfc053c67434f46"},
|
||||
{file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a386ebe437176aab38c041de1260cd3ea459c6ce5263594399880bbc398225b2"},
|
||||
{file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:ccd16eb18a849fd8dcb23e23380e2f0a354e8daa0c984b8a732d9cfaba3a776d"},
|
||||
{file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:e6a5bf2cba5ae1bb80b154ed68a3cfa2fa00fde979a7f50d6598d3e17d9ac20c"},
|
||||
{file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:45de3f87179c1823e6d9e32156fb14c1927fcc9aba21433f088fdfb555b77c10"},
|
||||
{file = "charset_normalizer-3.2.0-cp38-cp38-win32.whl", hash = "sha256:1000fba1057b92a65daec275aec30586c3de2401ccdcd41f8a5c1e2c87078706"},
|
||||
{file = "charset_normalizer-3.2.0-cp38-cp38-win_amd64.whl", hash = "sha256:8b2c760cfc7042b27ebdb4a43a4453bd829a5742503599144d54a032c5dc7e9e"},
|
||||
{file = "charset_normalizer-3.2.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:855eafa5d5a2034b4621c74925d89c5efef61418570e5ef9b37717d9c796419c"},
|
||||
{file = "charset_normalizer-3.2.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:203f0c8871d5a7987be20c72442488a0b8cfd0f43b7973771640fc593f56321f"},
|
||||
{file = "charset_normalizer-3.2.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e857a2232ba53ae940d3456f7533ce6ca98b81917d47adc3c7fd55dad8fab858"},
|
||||
{file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5e86d77b090dbddbe78867a0275cb4df08ea195e660f1f7f13435a4649e954e5"},
|
||||
{file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c4fb39a81950ec280984b3a44f5bd12819953dc5fa3a7e6fa7a80db5ee853952"},
|
||||
{file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2dee8e57f052ef5353cf608e0b4c871aee320dd1b87d351c28764fc0ca55f9f4"},
|
||||
{file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8700f06d0ce6f128de3ccdbc1acaea1ee264d2caa9ca05daaf492fde7c2a7200"},
|
||||
{file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1920d4ff15ce893210c1f0c0e9d19bfbecb7983c76b33f046c13a8ffbd570252"},
|
||||
{file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:c1c76a1743432b4b60ab3358c937a3fe1341c828ae6194108a94c69028247f22"},
|
||||
{file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:f7560358a6811e52e9c4d142d497f1a6e10103d3a6881f18d04dbce3729c0e2c"},
|
||||
{file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:c8063cf17b19661471ecbdb3df1c84f24ad2e389e326ccaf89e3fb2484d8dd7e"},
|
||||
{file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:cd6dbe0238f7743d0efe563ab46294f54f9bc8f4b9bcf57c3c666cc5bc9d1299"},
|
||||
{file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:1249cbbf3d3b04902ff081ffbb33ce3377fa6e4c7356f759f3cd076cc138d020"},
|
||||
{file = "charset_normalizer-3.2.0-cp39-cp39-win32.whl", hash = "sha256:6c409c0deba34f147f77efaa67b8e4bb83d2f11c8806405f76397ae5b8c0d1c9"},
|
||||
{file = "charset_normalizer-3.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:7095f6fbfaa55defb6b733cfeb14efaae7a29f0b59d8cf213be4e7ca0b857b80"},
|
||||
{file = "charset_normalizer-3.2.0-py3-none-any.whl", hash = "sha256:8e098148dd37b4ce3baca71fb394c81dc5d9c7728c95df695d2dca218edf40e6"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "colorama"
|
||||
version = "0.4.6"
|
||||
description = "Cross-platform colored terminal text."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
|
||||
files = [
|
||||
{file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
|
||||
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "commitizen"
|
||||
version = "3.7.0"
|
||||
description = "Python commitizen client tool"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7,<4.0"
|
||||
files = [
|
||||
{file = "commitizen-3.7.0-py3-none-any.whl", hash = "sha256:473e703f4d3cfa14250ee197a7a47acb02c064d590f351eb94338385427e53e3"},
|
||||
{file = "commitizen-3.7.0.tar.gz", hash = "sha256:c2c83817981f539f0c92a5f16a5d82e41954fdc886ea651b2f5a07f078c8bbaf"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
argcomplete = ">=1.12.1,<3.2"
|
||||
charset-normalizer = ">=2.1.0,<4"
|
||||
colorama = ">=0.4.1,<0.5.0"
|
||||
decli = ">=0.6.0,<0.7.0"
|
||||
importlib_metadata = ">=4.13,<7"
|
||||
jinja2 = ">=2.10.3"
|
||||
packaging = ">=19"
|
||||
pyyaml = ">=3.08"
|
||||
questionary = ">=1.4.0,<2.0.0"
|
||||
termcolor = ">=1.1,<3"
|
||||
tomlkit = ">=0.5.3,<1.0.0"
|
||||
|
||||
[[package]]
|
||||
name = "decli"
|
||||
version = "0.6.1"
|
||||
description = "Minimal, easy-to-use, declarative cli tool"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "decli-0.6.1-py3-none-any.whl", hash = "sha256:7815ac58617764e1a200d7cadac6315fcaacc24d727d182f9878dd6378ccf869"},
|
||||
{file = "decli-0.6.1.tar.gz", hash = "sha256:ed88ccb947701e8e5509b7945fda56e150e2ac74a69f25d47ac85ef30ab0c0f0"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "distlib"
|
||||
version = "0.3.7"
|
||||
description = "Distribution utilities"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
files = [
|
||||
{file = "distlib-0.3.7-py2.py3-none-any.whl", hash = "sha256:2e24928bc811348f0feb63014e97aaae3037f2cf48712d51ae61df7fd6075057"},
|
||||
{file = "distlib-0.3.7.tar.gz", hash = "sha256:9dafe54b34a028eafd95039d5e5d4851a13734540f1331060d31c9916e7147a8"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "filelock"
|
||||
version = "3.12.3"
|
||||
description = "A platform independent file lock."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
files = [
|
||||
{file = "filelock-3.12.3-py3-none-any.whl", hash = "sha256:f067e40ccc40f2b48395a80fcbd4728262fab54e232e090a4063ab804179efeb"},
|
||||
{file = "filelock-3.12.3.tar.gz", hash = "sha256:0ecc1dd2ec4672a10c8550a8182f1bd0c0a5088470ecd5a125e45f49472fac3d"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
docs = ["furo (>=2023.7.26)", "sphinx (>=7.1.2)", "sphinx-autodoc-typehints (>=1.24)"]
|
||||
testing = ["covdefaults (>=2.3)", "coverage (>=7.3)", "diff-cover (>=7.7)", "pytest (>=7.4)", "pytest-cov (>=4.1)", "pytest-mock (>=3.11.1)", "pytest-timeout (>=2.1)"]
|
||||
|
||||
[[package]]
|
||||
name = "identify"
|
||||
version = "2.5.27"
|
||||
description = "File identification library for Python"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
files = [
|
||||
{file = "identify-2.5.27-py2.py3-none-any.whl", hash = "sha256:fdb527b2dfe24602809b2201e033c2a113d7bdf716db3ca8e3243f735dcecaba"},
|
||||
{file = "identify-2.5.27.tar.gz", hash = "sha256:287b75b04a0e22d727bc9a41f0d4f3c1bcada97490fa6eabb5b28f0e9097e733"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
license = ["ukkonen"]
|
||||
|
||||
[[package]]
|
||||
name = "importlib-metadata"
|
||||
version = "6.8.0"
|
||||
description = "Read metadata from Python packages"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
files = [
|
||||
{file = "importlib_metadata-6.8.0-py3-none-any.whl", hash = "sha256:3ebb78df84a805d7698245025b975d9d67053cd94c79245ba4b3eb694abe68bb"},
|
||||
{file = "importlib_metadata-6.8.0.tar.gz", hash = "sha256:dbace7892d8c0c4ac1ad096662232f831d4e64f4c4545bd53016a3e9d4654743"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
zipp = ">=0.5"
|
||||
|
||||
[package.extras]
|
||||
docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"]
|
||||
perf = ["ipython"]
|
||||
testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)", "pytest-ruff"]
|
||||
|
||||
[[package]]
|
||||
name = "jinja2"
|
||||
version = "3.1.2"
|
||||
description = "A very fast and expressive template engine."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "Jinja2-3.1.2-py3-none-any.whl", hash = "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61"},
|
||||
{file = "Jinja2-3.1.2.tar.gz", hash = "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
MarkupSafe = ">=2.0"
|
||||
|
||||
[package.extras]
|
||||
i18n = ["Babel (>=2.7)"]
|
||||
|
||||
[[package]]
|
||||
name = "markupsafe"
|
||||
version = "2.1.3"
|
||||
description = "Safely add untrusted strings to HTML/XML markup."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "MarkupSafe-2.1.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:cd0f502fe016460680cd20aaa5a76d241d6f35a1c3350c474bac1273803893fa"},
|
||||
{file = "MarkupSafe-2.1.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e09031c87a1e51556fdcb46e5bd4f59dfb743061cf93c4d6831bf894f125eb57"},
|
||||
{file = "MarkupSafe-2.1.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:68e78619a61ecf91e76aa3e6e8e33fc4894a2bebe93410754bd28fce0a8a4f9f"},
|
||||
{file = "MarkupSafe-2.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65c1a9bcdadc6c28eecee2c119465aebff8f7a584dd719facdd9e825ec61ab52"},
|
||||
{file = "MarkupSafe-2.1.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:525808b8019e36eb524b8c68acdd63a37e75714eac50e988180b169d64480a00"},
|
||||
{file = "MarkupSafe-2.1.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:962f82a3086483f5e5f64dbad880d31038b698494799b097bc59c2edf392fce6"},
|
||||
{file = "MarkupSafe-2.1.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:aa7bd130efab1c280bed0f45501b7c8795f9fdbeb02e965371bbef3523627779"},
|
||||
{file = "MarkupSafe-2.1.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:c9c804664ebe8f83a211cace637506669e7890fec1b4195b505c214e50dd4eb7"},
|
||||
{file = "MarkupSafe-2.1.3-cp310-cp310-win32.whl", hash = "sha256:10bbfe99883db80bdbaff2dcf681dfc6533a614f700da1287707e8a5d78a8431"},
|
||||
{file = "MarkupSafe-2.1.3-cp310-cp310-win_amd64.whl", hash = "sha256:1577735524cdad32f9f694208aa75e422adba74f1baee7551620e43a3141f559"},
|
||||
{file = "MarkupSafe-2.1.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:ad9e82fb8f09ade1c3e1b996a6337afac2b8b9e365f926f5a61aacc71adc5b3c"},
|
||||
{file = "MarkupSafe-2.1.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3c0fae6c3be832a0a0473ac912810b2877c8cb9d76ca48de1ed31e1c68386575"},
|
||||
{file = "MarkupSafe-2.1.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b076b6226fb84157e3f7c971a47ff3a679d837cf338547532ab866c57930dbee"},
|
||||
{file = "MarkupSafe-2.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bfce63a9e7834b12b87c64d6b155fdd9b3b96191b6bd334bf37db7ff1fe457f2"},
|
||||
{file = "MarkupSafe-2.1.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:338ae27d6b8745585f87218a3f23f1512dbf52c26c28e322dbe54bcede54ccb9"},
|
||||
{file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e4dd52d80b8c83fdce44e12478ad2e85c64ea965e75d66dbeafb0a3e77308fcc"},
|
||||
{file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:df0be2b576a7abbf737b1575f048c23fb1d769f267ec4358296f31c2479db8f9"},
|
||||
{file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5bbe06f8eeafd38e5d0a4894ffec89378b6c6a625ff57e3028921f8ff59318ac"},
|
||||
{file = "MarkupSafe-2.1.3-cp311-cp311-win32.whl", hash = "sha256:dd15ff04ffd7e05ffcb7fe79f1b98041b8ea30ae9234aed2a9168b5797c3effb"},
|
||||
{file = "MarkupSafe-2.1.3-cp311-cp311-win_amd64.whl", hash = "sha256:134da1eca9ec0ae528110ccc9e48041e0828d79f24121a1a146161103c76e686"},
|
||||
{file = "MarkupSafe-2.1.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8e254ae696c88d98da6555f5ace2279cf7cd5b3f52be2b5cf97feafe883b58d2"},
|
||||
{file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb0932dc158471523c9637e807d9bfb93e06a95cbf010f1a38b98623b929ef2b"},
|
||||
{file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9402b03f1a1b4dc4c19845e5c749e3ab82d5078d16a2a4c2cd2df62d57bb0707"},
|
||||
{file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ca379055a47383d02a5400cb0d110cef0a776fc644cda797db0c5696cfd7e18e"},
|
||||
{file = "MarkupSafe-2.1.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:b7ff0f54cb4ff66dd38bebd335a38e2c22c41a8ee45aa608efc890ac3e3931bc"},
|
||||
{file = "MarkupSafe-2.1.3-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c011a4149cfbcf9f03994ec2edffcb8b1dc2d2aede7ca243746df97a5d41ce48"},
|
||||
{file = "MarkupSafe-2.1.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:56d9f2ecac662ca1611d183feb03a3fa4406469dafe241673d521dd5ae92a155"},
|
||||
{file = "MarkupSafe-2.1.3-cp37-cp37m-win32.whl", hash = "sha256:8758846a7e80910096950b67071243da3e5a20ed2546e6392603c096778d48e0"},
|
||||
{file = "MarkupSafe-2.1.3-cp37-cp37m-win_amd64.whl", hash = "sha256:787003c0ddb00500e49a10f2844fac87aa6ce977b90b0feaaf9de23c22508b24"},
|
||||
{file = "MarkupSafe-2.1.3-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:2ef12179d3a291be237280175b542c07a36e7f60718296278d8593d21ca937d4"},
|
||||
{file = "MarkupSafe-2.1.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2c1b19b3aaacc6e57b7e25710ff571c24d6c3613a45e905b1fde04d691b98ee0"},
|
||||
{file = "MarkupSafe-2.1.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8afafd99945ead6e075b973fefa56379c5b5c53fd8937dad92c662da5d8fd5ee"},
|
||||
{file = "MarkupSafe-2.1.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c41976a29d078bb235fea9b2ecd3da465df42a562910f9022f1a03107bd02be"},
|
||||
{file = "MarkupSafe-2.1.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d080e0a5eb2529460b30190fcfcc4199bd7f827663f858a226a81bc27beaa97e"},
|
||||
{file = "MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:69c0f17e9f5a7afdf2cc9fb2d1ce6aabdb3bafb7f38017c0b77862bcec2bbad8"},
|
||||
{file = "MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:504b320cd4b7eff6f968eddf81127112db685e81f7e36e75f9f84f0df46041c3"},
|
||||
{file = "MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:42de32b22b6b804f42c5d98be4f7e5e977ecdd9ee9b660fda1a3edf03b11792d"},
|
||||
{file = "MarkupSafe-2.1.3-cp38-cp38-win32.whl", hash = "sha256:ceb01949af7121f9fc39f7d27f91be8546f3fb112c608bc4029aef0bab86a2a5"},
|
||||
{file = "MarkupSafe-2.1.3-cp38-cp38-win_amd64.whl", hash = "sha256:1b40069d487e7edb2676d3fbdb2b0829ffa2cd63a2ec26c4938b2d34391b4ecc"},
|
||||
{file = "MarkupSafe-2.1.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:8023faf4e01efadfa183e863fefde0046de576c6f14659e8782065bcece22198"},
|
||||
{file = "MarkupSafe-2.1.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6b2b56950d93e41f33b4223ead100ea0fe11f8e6ee5f641eb753ce4b77a7042b"},
|
||||
{file = "MarkupSafe-2.1.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9dcdfd0eaf283af041973bff14a2e143b8bd64e069f4c383416ecd79a81aab58"},
|
||||
{file = "MarkupSafe-2.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:05fb21170423db021895e1ea1e1f3ab3adb85d1c2333cbc2310f2a26bc77272e"},
|
||||
{file = "MarkupSafe-2.1.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:282c2cb35b5b673bbcadb33a585408104df04f14b2d9b01d4c345a3b92861c2c"},
|
||||
{file = "MarkupSafe-2.1.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ab4a0df41e7c16a1392727727e7998a467472d0ad65f3ad5e6e765015df08636"},
|
||||
{file = "MarkupSafe-2.1.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:7ef3cb2ebbf91e330e3bb937efada0edd9003683db6b57bb108c4001f37a02ea"},
|
||||
{file = "MarkupSafe-2.1.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:0a4e4a1aff6c7ac4cd55792abf96c915634c2b97e3cc1c7129578aa68ebd754e"},
|
||||
{file = "MarkupSafe-2.1.3-cp39-cp39-win32.whl", hash = "sha256:fec21693218efe39aa7f8599346e90c705afa52c5b31ae019b2e57e8f6542bb2"},
|
||||
{file = "MarkupSafe-2.1.3-cp39-cp39-win_amd64.whl", hash = "sha256:3fd4abcb888d15a94f32b75d8fd18ee162ca0c064f35b11134be77050296d6ba"},
|
||||
{file = "MarkupSafe-2.1.3.tar.gz", hash = "sha256:af598ed32d6ae86f1b747b82783958b1a4ab8f617b06fe68795c7f026abbdcad"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nodeenv"
|
||||
version = "1.8.0"
|
||||
description = "Node.js virtual environment builder"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*"
|
||||
files = [
|
||||
{file = "nodeenv-1.8.0-py2.py3-none-any.whl", hash = "sha256:df865724bb3c3adc86b3876fa209771517b0cfe596beff01a92700e0e8be4cec"},
|
||||
{file = "nodeenv-1.8.0.tar.gz", hash = "sha256:d51e0c37e64fbf47d017feac3145cdbb58836d7eee8c6f6d3b6880c5456227d2"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
setuptools = "*"
|
||||
|
||||
[[package]]
|
||||
name = "packaging"
|
||||
version = "23.1"
|
||||
description = "Core utilities for Python packages"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "packaging-23.1-py3-none-any.whl", hash = "sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61"},
|
||||
{file = "packaging-23.1.tar.gz", hash = "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pastel"
|
||||
version = "0.2.1"
|
||||
description = "Bring colors to your terminal."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
|
||||
files = [
|
||||
{file = "pastel-0.2.1-py2.py3-none-any.whl", hash = "sha256:4349225fcdf6c2bb34d483e523475de5bb04a5c10ef711263452cb37d7dd4364"},
|
||||
{file = "pastel-0.2.1.tar.gz", hash = "sha256:e6581ac04e973cac858828c6202c1e1e81fee1dc7de7683f3e1ffe0bfd8a573d"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pathspec"
|
||||
version = "0.11.2"
|
||||
description = "Utility library for gitignore style pattern matching of file paths."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "pathspec-0.11.2-py3-none-any.whl", hash = "sha256:1d6ed233af05e679efb96b1851550ea95bbb64b7c490b0f5aa52996c11e92a20"},
|
||||
{file = "pathspec-0.11.2.tar.gz", hash = "sha256:e0d8d0ac2f12da61956eb2306b69f9469b42f4deb0f3cb6ed47b9cce9996ced3"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "platformdirs"
|
||||
version = "3.10.0"
|
||||
description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "platformdirs-3.10.0-py3-none-any.whl", hash = "sha256:d7c24979f292f916dc9cbf8648319032f551ea8c49a4c9bf2fb556a02070ec1d"},
|
||||
{file = "platformdirs-3.10.0.tar.gz", hash = "sha256:b45696dab2d7cc691a3226759c0d3b00c47c8b6e293d96f6436f733303f77f6d"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.1)", "sphinx-autodoc-typehints (>=1.24)"]
|
||||
test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-cov (>=4.1)", "pytest-mock (>=3.11.1)"]
|
||||
|
||||
[[package]]
|
||||
name = "poethepoet"
|
||||
version = "0.22.0"
|
||||
description = "A task runner that works well with poetry."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
files = [
|
||||
{file = "poethepoet-0.22.0-py3-none-any.whl", hash = "sha256:f654e52c19b7c689d5293ab6a065787b21f125884c0b367650292df4f3cb508c"},
|
||||
{file = "poethepoet-0.22.0.tar.gz", hash = "sha256:659d7678fd8b349bd40941e3de7d6d386171dab3e7c8babcdcd8ead288c9ea47"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
pastel = ">=0.2.1,<0.3.0"
|
||||
tomli = ">=1.2.2"
|
||||
|
||||
[package.extras]
|
||||
poetry-plugin = ["poetry (>=1.0,<2.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "pre-commit"
|
||||
version = "3.3.3"
|
||||
description = "A framework for managing and maintaining multi-language pre-commit hooks."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
files = [
|
||||
{file = "pre_commit-3.3.3-py2.py3-none-any.whl", hash = "sha256:10badb65d6a38caff29703362271d7dca483d01da88f9d7e05d0b97171c136cb"},
|
||||
{file = "pre_commit-3.3.3.tar.gz", hash = "sha256:a2256f489cd913d575c145132ae196fe335da32d91a8294b7afe6622335dd023"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
cfgv = ">=2.0.0"
|
||||
identify = ">=1.0.0"
|
||||
nodeenv = ">=0.11.1"
|
||||
pyyaml = ">=5.1"
|
||||
virtualenv = ">=20.10.0"
|
||||
|
||||
[[package]]
|
||||
name = "prompt-toolkit"
|
||||
version = "3.0.39"
|
||||
description = "Library for building powerful interactive command lines in Python"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7.0"
|
||||
files = [
|
||||
{file = "prompt_toolkit-3.0.39-py3-none-any.whl", hash = "sha256:9dffbe1d8acf91e3de75f3b544e4842382fc06c6babe903ac9acb74dc6e08d88"},
|
||||
{file = "prompt_toolkit-3.0.39.tar.gz", hash = "sha256:04505ade687dc26dc4284b1ad19a83be2f2afe83e7a828ace0c72f3a1df72aac"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
wcwidth = "*"
|
||||
|
||||
[[package]]
|
||||
name = "pyyaml"
|
||||
version = "6.0.1"
|
||||
description = "YAML parser and emitter for Python"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
files = [
|
||||
{file = "PyYAML-6.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a"},
|
||||
{file = "PyYAML-6.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f"},
|
||||
{file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"},
|
||||
{file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"},
|
||||
{file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"},
|
||||
{file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"},
|
||||
{file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"},
|
||||
{file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"},
|
||||
{file = "PyYAML-6.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab"},
|
||||
{file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"},
|
||||
{file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"},
|
||||
{file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"},
|
||||
{file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"},
|
||||
{file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"},
|
||||
{file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"},
|
||||
{file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"},
|
||||
{file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"},
|
||||
{file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd"},
|
||||
{file = "PyYAML-6.0.1-cp36-cp36m-win32.whl", hash = "sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585"},
|
||||
{file = "PyYAML-6.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa"},
|
||||
{file = "PyYAML-6.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3"},
|
||||
{file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27"},
|
||||
{file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3"},
|
||||
{file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c"},
|
||||
{file = "PyYAML-6.0.1-cp37-cp37m-win32.whl", hash = "sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba"},
|
||||
{file = "PyYAML-6.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867"},
|
||||
{file = "PyYAML-6.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595"},
|
||||
{file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"},
|
||||
{file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"},
|
||||
{file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"},
|
||||
{file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"},
|
||||
{file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"},
|
||||
{file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"},
|
||||
{file = "PyYAML-6.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859"},
|
||||
{file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"},
|
||||
{file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"},
|
||||
{file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"},
|
||||
{file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"},
|
||||
{file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"},
|
||||
{file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "questionary"
|
||||
version = "1.10.0"
|
||||
description = "Python library to build pretty command line user prompts ⭐️"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6,<4.0"
|
||||
files = [
|
||||
{file = "questionary-1.10.0-py3-none-any.whl", hash = "sha256:fecfcc8cca110fda9d561cb83f1e97ecbb93c613ff857f655818839dac74ce90"},
|
||||
{file = "questionary-1.10.0.tar.gz", hash = "sha256:600d3aefecce26d48d97eee936fdb66e4bc27f934c3ab6dd1e292c4f43946d90"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
prompt_toolkit = ">=2.0,<4.0"
|
||||
|
||||
[package.extras]
|
||||
docs = ["Sphinx (>=3.3,<4.0)", "sphinx-autobuild (>=2020.9.1,<2021.0.0)", "sphinx-autodoc-typehints (>=1.11.1,<2.0.0)", "sphinx-copybutton (>=0.3.1,<0.4.0)", "sphinx-rtd-theme (>=0.5.0,<0.6.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "setuptools"
|
||||
version = "68.1.2"
|
||||
description = "Easily download, build, install, upgrade, and uninstall Python packages"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
files = [
|
||||
{file = "setuptools-68.1.2-py3-none-any.whl", hash = "sha256:3d8083eed2d13afc9426f227b24fd1659489ec107c0e86cec2ffdde5c92e790b"},
|
||||
{file = "setuptools-68.1.2.tar.gz", hash = "sha256:3d4dfa6d95f1b101d695a6160a7626e15583af71a5f52176efa5d39a054d475d"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5,<=7.1.2)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (==0.8.3)", "sphinx-reredirects", "sphinxcontrib-towncrier"]
|
||||
testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"]
|
||||
testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"]
|
||||
|
||||
[[package]]
|
||||
name = "termcolor"
|
||||
version = "2.3.0"
|
||||
description = "ANSI color formatting for output in terminal"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "termcolor-2.3.0-py3-none-any.whl", hash = "sha256:3afb05607b89aed0ffe25202399ee0867ad4d3cb4180d98aaf8eefa6a5f7d475"},
|
||||
{file = "termcolor-2.3.0.tar.gz", hash = "sha256:b5b08f68937f138fe92f6c089b99f1e2da0ae56c52b78bf7075fd95420fd9a5a"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
tests = ["pytest", "pytest-cov"]
|
||||
|
||||
[[package]]
|
||||
name = "tomli"
|
||||
version = "2.0.1"
|
||||
description = "A lil' TOML parser"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"},
|
||||
{file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tomlkit"
|
||||
version = "0.12.1"
|
||||
description = "Style preserving TOML library"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "tomlkit-0.12.1-py3-none-any.whl", hash = "sha256:712cbd236609acc6a3e2e97253dfc52d4c2082982a88f61b640ecf0817eab899"},
|
||||
{file = "tomlkit-0.12.1.tar.gz", hash = "sha256:38e1ff8edb991273ec9f6181244a6a391ac30e9f5098e7535640ea6be97a7c86"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typos"
|
||||
version = "1.16.8"
|
||||
description = "Source Code Spelling Correction"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "typos-1.16.8-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:b4d0bf1728ff35849690c956b0c8f01f6cf00a86d4d76a2fcecda808345417bf"},
|
||||
{file = "typos-1.16.8-py3-none-macosx_11_0_arm64.whl", hash = "sha256:0155e64c26074aec76dabd5e716334aae6cef16371e6457536a7b27be638200e"},
|
||||
{file = "typos-1.16.8-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cc2b8831dfae748a831962036aa325d3a6cf339dbf397969779d31381b33081f"},
|
||||
{file = "typos-1.16.8-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:902c501e9527ceffd43f3f78356ae0c8e0f4e013981438cce91c56fe55fc4b7f"},
|
||||
{file = "typos-1.16.8-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f4ac08d8de1a1657bbe8467afa41776bd7d5991112543cd9337d120185f8b945"},
|
||||
{file = "typos-1.16.8-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:b3f3f714b03bad7d48b416b218be13395a5980ca1dd71f3e45f22ca0f7b2d44e"},
|
||||
{file = "typos-1.16.8-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1e31ea1b36e3860a16e399dacc2584a08fa4114a8f8d1520d7740ddbe1fad28a"},
|
||||
{file = "typos-1.16.8-py3-none-win32.whl", hash = "sha256:3df2e208e0a6385c9f1c990c7222ec2067e499162a7a6c615c0e730deadef4c8"},
|
||||
{file = "typos-1.16.8-py3-none-win_amd64.whl", hash = "sha256:a9a1ed3107c05f34045f2e697c6cdb339a15411ccfc4dd1358cf18d6c684d4a7"},
|
||||
{file = "typos-1.16.8.tar.gz", hash = "sha256:362b1238729eb8644cf9ece59886a40e7ef01eaaf4ff4910e511cb9cf97d5f21"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "virtualenv"
|
||||
version = "20.24.3"
|
||||
description = "Virtual Python Environment builder"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "virtualenv-20.24.3-py3-none-any.whl", hash = "sha256:95a6e9398b4967fbcb5fef2acec5efaf9aa4972049d9ae41f95e0972a683fd02"},
|
||||
{file = "virtualenv-20.24.3.tar.gz", hash = "sha256:e5c3b4ce817b0b328af041506a2a299418c98747c4b1e68cb7527e74ced23efc"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
distlib = ">=0.3.7,<1"
|
||||
filelock = ">=3.12.2,<4"
|
||||
platformdirs = ">=3.9.1,<4"
|
||||
|
||||
[package.extras]
|
||||
docs = ["furo (>=2023.5.20)", "proselint (>=0.13)", "sphinx (>=7.0.1)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"]
|
||||
test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"]
|
||||
|
||||
[[package]]
|
||||
name = "wcwidth"
|
||||
version = "0.2.6"
|
||||
description = "Measures the displayed width of unicode strings in a terminal"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
files = [
|
||||
{file = "wcwidth-0.2.6-py2.py3-none-any.whl", hash = "sha256:795b138f6875577cd91bba52baf9e445cd5118fd32723b460e30a0af30ea230e"},
|
||||
{file = "wcwidth-0.2.6.tar.gz", hash = "sha256:a5220780a404dbe3353789870978e472cfe477761f06ee55077256e509b156d0"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "yamllint"
|
||||
version = "1.32.0"
|
||||
description = "A linter for YAML files."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "yamllint-1.32.0-py3-none-any.whl", hash = "sha256:d97a66e48da820829d96077d76b8dfbe6c6140f106e558dae87e81ac4e6b30b7"},
|
||||
{file = "yamllint-1.32.0.tar.gz", hash = "sha256:d01dde008c65de5b235188ab3110bebc59d18e5c65fc8a58267cd211cd9df34a"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
pathspec = ">=0.5.3"
|
||||
pyyaml = "*"
|
||||
|
||||
[package.extras]
|
||||
dev = ["doc8", "flake8", "flake8-import-order", "rstcheck[sphinx]", "sphinx"]
|
||||
|
||||
[[package]]
|
||||
name = "zipp"
|
||||
version = "3.16.2"
|
||||
description = "Backport of pathlib-compatible object wrapper for zip files"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
files = [
|
||||
{file = "zipp-3.16.2-py3-none-any.whl", hash = "sha256:679e51dd4403591b2d6838a48de3d283f3d188412a9782faadf845f298736ba0"},
|
||||
{file = "zipp-3.16.2.tar.gz", hash = "sha256:ebc15946aa78bd63458992fc81ec3b6f7b1e92d51c35e6de1c3804e73b799147"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"]
|
||||
testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy (>=0.9.1)", "pytest-ruff"]
|
||||
|
||||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = "^3.11"
|
||||
content-hash = "ef6f88c4eb4131c2bc51eee77b4d0d10fc0a806fc4d4cb172af7b8b3dddcf3cb"
|
||||
48
pyproject.toml
Normal file
48
pyproject.toml
Normal file
@@ -0,0 +1,48 @@
|
||||
[tool.poetry]
|
||||
authors = ["Nathaniel Landau <nate@natelandau.com>"]
|
||||
description = "Shell scripting utility functions and a bash script boilerplate templates"
|
||||
homepage = "https://github.com/natelandau/shell-scripting-templates"
|
||||
license = "MIT"
|
||||
name = "shell-scripting-templates"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/natelandau/shell-scripting-templates"
|
||||
version = "0.1.0"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
commitizen = "^3.7.0"
|
||||
poethepoet = "^0.22.0"
|
||||
pre-commit = "^3.3.3"
|
||||
python = "^3.11"
|
||||
typos = "^1.16.8"
|
||||
yamllint = "^1.32.0"
|
||||
|
||||
[build-system]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
requires = ["poetry-core"]
|
||||
|
||||
[tool.commitizen]
|
||||
bump_message = "bump(release): v$current_version → v$new_version"
|
||||
tag_format = "v$version"
|
||||
update_changelog_on_bump = true
|
||||
version = "0.1.0"
|
||||
version_files = ["pyproject.toml:version"]
|
||||
|
||||
[tool.poe.tasks]
|
||||
|
||||
[tool.poe.tasks.lint]
|
||||
help = "Lint this package"
|
||||
|
||||
[[tool.poe.tasks.lint.sequence]]
|
||||
shell = "poetry check"
|
||||
|
||||
[[tool.poe.tasks.lint.sequence]]
|
||||
shell = "typos"
|
||||
|
||||
[[tool.poe.tasks.lint.sequence]]
|
||||
shell = "yamllint ."
|
||||
|
||||
# [[tool.poe.tasks.lint.sequence]]
|
||||
# shell = "shellcheck bin-*/*"
|
||||
|
||||
[[tool.poe.tasks.lint.sequence]]
|
||||
shell = "pre-commit run --all-files"
|
||||
@@ -485,4 +485,4 @@ s/&/\&/g
|
||||
|
||||
# http://www.w3schools.com/tags/ref_entities.asp
|
||||
# ^([^ \t]+)[ \t]+(&[^;]*;)[ \t]+(&[^;]*;).*$
|
||||
# s/\2/\1/g\ns/\3/\1/g
|
||||
# s/\2/\1/g\ns/\3/\1/g
|
||||
|
||||
@@ -216,4 +216,4 @@ s/◊/\◊/g
|
||||
s/♠/\♠/g
|
||||
s/♣/\♣/g
|
||||
s/♥/\♥/g
|
||||
s/♦/\♦/g
|
||||
s/♦/\♦/g
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# format \b[word]\b where '\b' is a word delimeter
|
||||
# format \b[word]\b where '\b' is a word delimiter
|
||||
# format //gI where the 'I' is case insensitivity. Only works in gnu-sed.
|
||||
s/\ba\b//gI
|
||||
s/\bable\b//gI
|
||||
@@ -1290,4 +1290,4 @@ s/\bz\b//gI
|
||||
s/\bza\b//gI
|
||||
s/\bzero\b//gI
|
||||
s/\bzm\b//gI
|
||||
s/\bzr\b//gI
|
||||
s/\bzr\b//gI
|
||||
|
||||
@@ -92,7 +92,7 @@ teardown() {
|
||||
}
|
||||
|
||||
@test "_commandExists_: false" {
|
||||
run _commandExists_ "someNonexistantBinary"
|
||||
run _commandExists_ "someNonexistentBinary"
|
||||
assert_failure
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ teardown() {
|
||||
|
||||
@test "_varIsFalse_: false" {
|
||||
testvar=true
|
||||
run _variableIsFalse_ "${testvar}"
|
||||
run _varIsFalse_ "${testvar}"
|
||||
assert_failure
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,17 @@ encrypted="${BATS_TEST_DIRNAME}/fixtures/test.md.enc"
|
||||
assert_output ""
|
||||
}
|
||||
|
||||
@test "_encryptFile_" {
|
||||
run _encryptFile_ "${unencrypted}" "test-encrypted.md.enc"
|
||||
assert_success
|
||||
assert_file_exist "test-encrypted.md.enc"
|
||||
run cat "test-encrypted.md.enc"
|
||||
assert_line --index 0 --partial "Salted__"
|
||||
}
|
||||
|
||||
# TODO: Test is broken but the function works. re-write test
|
||||
@test "_decryptFile_" {
|
||||
skip "Test is broken but the function works. re-write test"
|
||||
run _decryptFile_ "${encrypted}" "test-decrypted.md"
|
||||
assert_success
|
||||
assert_file_exist "test-decrypted.md"
|
||||
@@ -94,14 +104,6 @@ encrypted="${BATS_TEST_DIRNAME}/fixtures/test.md.enc"
|
||||
assert_line --index 1 "This repository contains everything needed to bootstrap and configure new Mac computer. Included here are:"
|
||||
}
|
||||
|
||||
@test "_encryptFile_" {
|
||||
run _encryptFile_ "${unencrypted}" "test-encrypted.md.enc"
|
||||
assert_success
|
||||
assert_file_exist "test-encrypted.md.enc"
|
||||
run cat "test-encrypted.md.enc"
|
||||
assert_line --index 0 --partial "Salted__"
|
||||
}
|
||||
|
||||
_testBackupFile_() {
|
||||
|
||||
@test "_backupFile_: no source" {
|
||||
@@ -299,11 +301,18 @@ _testParseYAML_() {
|
||||
assert_line --index 2 'line 3'
|
||||
}
|
||||
|
||||
@test "_randomLineFromFile_" {
|
||||
echo -e "line 1\nline 2\nline 3" > testfile.txt
|
||||
|
||||
run _randomLineFromFile_ "testfile.txt"
|
||||
assert_output --regexp "^line [123]$"
|
||||
}
|
||||
|
||||
@test "_sourceFile_ failure" {
|
||||
run _sourceFile_ "someNonExistantFile"
|
||||
run _sourceFile_ "someNonExistentFile"
|
||||
|
||||
assert_failure
|
||||
assert_output --partial "[ fatal] Attempted to source 'someNonExistantFile'. Not found"
|
||||
assert_output --partial "[ fatal] Attempted to source 'someNonExistentFile'. Not found"
|
||||
}
|
||||
|
||||
@test "_sourceFile_ success" {
|
||||
|
||||
36
test/fixtures/test.md
vendored
36
test/fixtures/test.md
vendored
@@ -2,11 +2,11 @@
|
||||
|
||||
This repository contains everything needed to bootstrap and configure new Mac computer. Included here are:
|
||||
|
||||
- dotfiles
|
||||
- ~/bin/ scripts
|
||||
- Configuration files
|
||||
- Scripting templates and utilities
|
||||
- `install.sh`, a script to put everything where it needs to go
|
||||
- dotfiles
|
||||
- ~/bin/ scripts
|
||||
- Configuration files
|
||||
- Scripting templates and utilities
|
||||
- `install.sh`, a script to put everything where it needs to go
|
||||
|
||||
**Disclaimer:** _I am not a professional programmer and I bear no responsibility whatsoever if any of these scripts wipes your computer, destroys your data, crashes your car, or otherwise causes mayhem and destruction. USE AT YOUR OWN RISK._
|
||||
|
||||
@@ -24,8 +24,8 @@ The files are organized into three subdirectories.
|
||||
dotfiles
|
||||
├── bin/
|
||||
├── config/
|
||||
│ ├── bash/
|
||||
│ └── shell/
|
||||
│ ├── bash/
|
||||
│ └── shell/
|
||||
├── install.sh
|
||||
├── install-config.yaml
|
||||
├── lib/
|
||||
@@ -34,20 +34,20 @@ dotfiles
|
||||
└── scripting/
|
||||
```
|
||||
|
||||
- **bin** - Symlinked to `~/bin` and is added to your `$PATH`.
|
||||
- **config** - Contains the elements needed to configure your environment and specific apps.
|
||||
- config/**bash** - Files in this directory are _sourced_ by `.bash_profile`.
|
||||
- config/**shell** - Files here are symlinked to your local environment. Ahem, dotfiles.
|
||||
- **lib** - Contains the scripts and configuration for `install.sh`
|
||||
- lib/**bootstrap** - Scripts here are executed by `install.sh` first.
|
||||
- lib/**configure** - Scripts here are executed by `install.sh` after packages have been installed
|
||||
- **config-install.yaml** - This YAML file contains the list of symlinks to be created, as well as the packages to be installed.
|
||||
- **scripting** - This directory contains bash scripting utilities and templates which I re-use often.
|
||||
- **bin** - Symlinked to `~/bin` and is added to your `$PATH`.
|
||||
- **config** - Contains the elements needed to configure your environment and specific apps.
|
||||
- config/**bash** - Files in this directory are _sourced_ by `.bash_profile`.
|
||||
- config/**shell** - Files here are symlinked to your local environment. Ahem, dotfiles.
|
||||
- **lib** - Contains the scripts and configuration for `install.sh`
|
||||
- lib/**bootstrap** - Scripts here are executed by `install.sh` first.
|
||||
- lib/**configure** - Scripts here are executed by `install.sh` after packages have been installed
|
||||
- **config-install.yaml** - This YAML file contains the list of symlinks to be created, as well as the packages to be installed.
|
||||
- **scripting** - This directory contains bash scripting utilities and templates which I re-use often.
|
||||
|
||||
**IMPORTANT:** Unless you want to use my defaults, make sure you do the following:
|
||||
|
||||
- Edit `config-install.yaml` to reflect your preferred packages
|
||||
- Review the files in `config/` to configure your own aliases, preferences, etc.
|
||||
- Edit `config-install.yaml` to reflect your preferred packages
|
||||
- Review the files in `config/` to configure your own aliases, preferences, etc.
|
||||
|
||||
#### Private Files
|
||||
|
||||
|
||||
BIN
test/fixtures/test.md.enc
vendored
BIN
test/fixtures/test.md.enc
vendored
Binary file not shown.
43
test/fixtures/yaml1.yaml
vendored
43
test/fixtures/yaml1.yaml
vendored
@@ -1,29 +1,30 @@
|
||||
---
|
||||
# A list of tasty fruits
|
||||
fruits:
|
||||
- Apple
|
||||
- Orange
|
||||
- Strawberry
|
||||
- Mango
|
||||
- Apple
|
||||
- Orange
|
||||
- Strawberry
|
||||
- Mango
|
||||
|
||||
# An single record
|
||||
employee:
|
||||
name: Jimmy veloper
|
||||
job: Developer
|
||||
skill: Elite
|
||||
name: Jimmy veloper
|
||||
job: Developer
|
||||
skill: Elite
|
||||
|
||||
# Multiple records
|
||||
employees:
|
||||
martin:
|
||||
name: Martin D'vloper
|
||||
job: Developer
|
||||
skills:
|
||||
- python
|
||||
- perl
|
||||
- pascal
|
||||
tabitha:
|
||||
name: Tabitha Bitumen
|
||||
job: Developer
|
||||
skills:
|
||||
- lisp
|
||||
- fortran
|
||||
- erlang
|
||||
martin:
|
||||
name: Martin D'vloper
|
||||
job: Developer
|
||||
skills:
|
||||
- python
|
||||
- perl
|
||||
- pascal
|
||||
tabitha:
|
||||
name: Tabitha Bitumen
|
||||
job: Developer
|
||||
skills:
|
||||
- lisp
|
||||
- fortran
|
||||
- erlang
|
||||
|
||||
27
test/fixtures/yaml1.yaml.txt
vendored
27
test/fixtures/yaml1.yaml.txt
vendored
@@ -1,17 +1,18 @@
|
||||
|
||||
fruits+=("Apple")
|
||||
fruits+=("Orange")
|
||||
fruits+=("Strawberry")
|
||||
fruits+=("Mango")
|
||||
employee_name=("Jimmy veloper")
|
||||
employee_job=("Developer")
|
||||
employee_skill=("Elite")
|
||||
employees_martin_name=("Martin D'vloper")
|
||||
employees_martin_job=("Developer")
|
||||
employees_martin_skills+=("python")
|
||||
employees_martin_skills+=("perl")
|
||||
employees_martin_skills+=("pascal")
|
||||
employees_tabitha_name=("Tabitha Bitumen")
|
||||
employees_tabitha_job=("Developer")
|
||||
employees_tabitha_skills+=("lisp")
|
||||
employees_tabitha_skills+=("fortran")
|
||||
employees_tabitha_skills+=("erlang")
|
||||
employee__name=("Jimmy veloper")
|
||||
employee__job=("Developer")
|
||||
employee__skill=("Elite")
|
||||
employees__martin__name=("Martin D'vloper")
|
||||
employees__martin__job=("Developer")
|
||||
employees__martin__skills+=("python")
|
||||
employees__martin__skills+=("perl")
|
||||
employees__martin__skills+=("pascal")
|
||||
employees__tabitha__name=("Tabitha Bitumen")
|
||||
employees__tabitha__job=("Developer")
|
||||
employees__tabitha__skills+=("lisp")
|
||||
employees__tabitha__skills+=("fortran")
|
||||
employees__tabitha__skills+=("erlang")
|
||||
|
||||
@@ -80,23 +80,23 @@ teardown() {
|
||||
}
|
||||
|
||||
@test "_execute_: Bad command" {
|
||||
run _execute_ "rm nonexistant.txt"
|
||||
run _execute_ "rm nonexistent.txt"
|
||||
|
||||
assert_failure
|
||||
assert_output --partial "[warning] rm nonexistant.txt"
|
||||
assert_output --partial "[warning] rm nonexistent.txt"
|
||||
}
|
||||
|
||||
@test "_execute_ -e: Bad command" {
|
||||
run _execute_ -e "rm nonexistant.txt"
|
||||
run _execute_ -e "rm nonexistent.txt"
|
||||
|
||||
assert_failure
|
||||
assert_output "error: rm nonexistant.txt"
|
||||
assert_output "error: rm nonexistent.txt"
|
||||
}
|
||||
|
||||
@test "_execute_ -p: Return 0 on bad command" {
|
||||
run _execute_ -p "rm nonexistant.txt"
|
||||
run _execute_ -p "rm nonexistent.txt"
|
||||
assert_success
|
||||
assert_output --partial "[warning] rm nonexistant.txt"
|
||||
assert_output --partial "[warning] rm nonexistent.txt"
|
||||
}
|
||||
|
||||
@test "_execute_: Good command" {
|
||||
@@ -156,9 +156,9 @@ teardown() {
|
||||
run _findBaseDir_
|
||||
assert_success
|
||||
if [ -d /usr/local/Cellar/ ]; then
|
||||
assert_output --regexp "^/usr/local/Cellar/bats-core/[0-9]\.[0-9]\.[0-9]"
|
||||
assert_output --regexp "^/usr/local/Cellar/bats-core/[0-9][0-9]?\.[0-9][0-9]?\.[0-9][0-9]?"
|
||||
elif [ -d /opt/homebrew/Cellar ]; then
|
||||
assert_output --regexp "^/opt/homebrew/Cellar/bats-core/[0-9]\.[0-9]\.[0-9]"
|
||||
assert_output --regexp "^/opt/homebrew/Cellar/bats-core/[0-9][0-9]?\.[0-9][0-9]?\.[0-9][0-9]?"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Submodule test/test_helper/bats-assert updated: 397c735212...44913ffe60
Submodule test/test_helper/bats-file updated: 166ed1ab8a...805ffb74fe
@@ -194,7 +194,7 @@ header() { _alert_ header "${1}" "${2:-}"; }
|
||||
debug() { _alert_ debug "${1}" "${2:-}"; }
|
||||
fatal() {
|
||||
_alert_ fatal "${1}" "${2:-}"
|
||||
_safeExit_ "1"
|
||||
return 1
|
||||
}
|
||||
|
||||
_printFuncStack_() {
|
||||
|
||||
@@ -160,7 +160,7 @@ _isInternetAvailable_() {
|
||||
else
|
||||
_checkInternet="$(curl --compressed -Is google.com -m 10)"
|
||||
fi
|
||||
if [[ -z ${_checkInternet:-} ]]; then
|
||||
if [[ -z ${_checkInternet-} ]]; then
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
@@ -277,7 +277,7 @@ _rootAvailable_() {
|
||||
|
||||
if [[ ${EUID} -eq 0 ]]; then
|
||||
_superuser=true
|
||||
elif [[ -z ${1:-} ]]; then
|
||||
elif [[ -z ${1-} ]]; then
|
||||
debug 'Sudo: Updating cached credentials ...'
|
||||
if sudo -v; then
|
||||
if [[ $(sudo -H -- "${BASH}" -c 'printf "%s" "$EUID"') -eq 0 ]]; then
|
||||
@@ -312,7 +312,7 @@ _varIsTrue_() {
|
||||
|
||||
[[ $# == 0 ]] && fatal "Missing required argument to ${FUNCNAME[0]}"
|
||||
|
||||
[[ ${1} == "true" || ${1} == 0 ]] && return 0 || return 1
|
||||
[[ ${1,,} == "true" || ${1} == 0 ]] && return 0 || return 1
|
||||
}
|
||||
|
||||
_varIsFalse_() {
|
||||
@@ -328,7 +328,7 @@ _varIsFalse_() {
|
||||
|
||||
[[ $# == 0 ]] && fatal "Missing required argument to ${FUNCNAME[0]}"
|
||||
|
||||
[[ ${1} == false || ${1} == 1 ]] && return 0 || return 1
|
||||
[[ ${1,,} == "false" || ${1} == 1 ]] && return 0 || return 1
|
||||
}
|
||||
|
||||
_varIsEmpty_() {
|
||||
@@ -342,7 +342,7 @@ _varIsEmpty_() {
|
||||
# USAGE
|
||||
# _varIsEmpty_ "${var}"
|
||||
|
||||
[[ -z ${1:-} || ${1:-} == "null" ]] && return 0 || return 1
|
||||
[[ -z ${1-} || ${1-} == "null" ]] && return 0 || return 1
|
||||
}
|
||||
|
||||
_isIPv6_() {
|
||||
|
||||
@@ -8,7 +8,7 @@ _backupFile_() {
|
||||
# $1 (Required) - Source file
|
||||
# $2 (Optional) - Destination dir name used only with -d flag (defaults to ./backup)
|
||||
# OPTS:
|
||||
# -d - Move files to a backup direcory
|
||||
# -d - Move files to a backup directory
|
||||
# -m - Replaces copy (default) with move, effectively removing the original file
|
||||
# REQUIRES:
|
||||
# _execute_
|
||||
@@ -84,7 +84,7 @@ _createUniqueFilename_() {
|
||||
# filenames by incrementing a number at the end of the filename
|
||||
# ARGS:
|
||||
# $1 (Required) - Name of file to be created
|
||||
# $2 (Optional) - Separation characted (Defaults to a period '.')
|
||||
# $2 (Optional) - Separation character (Defaults to a period '.')
|
||||
# OUTS:
|
||||
# stdout: Unique name of file
|
||||
# 0 if successful
|
||||
@@ -399,7 +399,7 @@ _fileExtension_() {
|
||||
|
||||
_filePath_() {
|
||||
# DESC:
|
||||
# Finds the directory name from a file path. If it exists on filesystem, print
|
||||
# Finds the directory name from a file path. If it exists on filesystem, print
|
||||
# absolute path. If a string, remove the filename and return the path
|
||||
# ARGS:
|
||||
# $1 (Required) - Input string path
|
||||
@@ -668,7 +668,7 @@ _parseYAML_() {
|
||||
vn=""; for (i=0; i<indent; i++) {vn=(vn)(vname[i])("_")}
|
||||
printf("%s%s%s%s=(\"%s\")\n", "'"${_prefix}"'",vn, $2, conj[indent-1],$3);
|
||||
}
|
||||
}' | sed 's/_=/+=/g' | sed 's/[[:space:]]*#.*"/"/g'
|
||||
}' | sed 's/__=/+=/g' | sed 's/_=/+=/g' | sed 's/[[:space:]]*#.*"/"/g' | sed 's/=("--")//g'
|
||||
}
|
||||
|
||||
_printFileBetween_() (
|
||||
@@ -749,6 +749,31 @@ _printFileBetween_() (
|
||||
fi
|
||||
)
|
||||
|
||||
_randomLineFromFile_() {
|
||||
# DESC:
|
||||
# Returns a random line from a file
|
||||
# ARGS:
|
||||
# $1 (Required) - Input file
|
||||
# OUTS:
|
||||
# Returns random line from file
|
||||
# USAGE:
|
||||
# _randomLineFromFile_ "file.txt"
|
||||
|
||||
[[ $# == 0 ]] && fatal "Missing required argument to ${FUNCNAME[0]}"
|
||||
|
||||
local _fileToRead="$1"
|
||||
local _rnd
|
||||
|
||||
[ ! -f "${_fileToRead}" ] \
|
||||
&& {
|
||||
error "'${_fileToRead}' not found"
|
||||
return 1
|
||||
}
|
||||
|
||||
_rnd=$((1 + RANDOM % $(wc -l <"${_fileToRead}")))
|
||||
sed -n "${_rnd}p" "${_fileToRead}"
|
||||
}
|
||||
|
||||
_readFile_() {
|
||||
# DESC:
|
||||
# Prints each line of a file
|
||||
|
||||
@@ -307,9 +307,9 @@ _splitString_() (
|
||||
|
||||
declare -a _arr=()
|
||||
local _input="${1}"
|
||||
local _delimeter="${2}"
|
||||
local _delimiter="${2}"
|
||||
|
||||
IFS="${_delimeter}" read -r -a _arr <<<"${_input}"
|
||||
IFS="${_delimiter}" read -r -a _arr <<<"${_input}"
|
||||
|
||||
printf '%s\n' "${_arr[@]}"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user