Commit Graph

18 Commits

Author SHA1 Message Date
aarondill 606b2f41c3 use RETVAL for elevate_priv
This stops the script from breaking if the user specified sudo command outputs to stdout
2023-07-05 13:30:30 -05:00
aarondill ebebf77cc8 fix error due to using wrong command name for `has_cmd` function 2023-07-05 13:23:57 -05:00
aarondill aaa1418519 ensure _man_dir/man1/ folder exists before copy
This fixes a logic error, where `$_man_dir` is checked to ensure it exists, but not the `man1` subdirectory.

It feels most reasonable to ensure the selected mandir exists, but not that the file structure of the directory is user-managed.
2023-07-05 13:16:06 -05:00
aarondill c9a4e52623 add explaination for shellcheck disable
SC3043 is the warning about lack of `local` definition in POSIX. This is a Dev Exp improvement, as it removes unneeded and unwanted warnings.
2023-07-05 13:05:35 -05:00
aarondill bd3dd1d0e8 add a vim modeline to end of document to ensure proper formatting with multiple collaborators 2023-07-05 13:03:56 -05:00
aarondill 86be4f460f reformat with shift_width=4
This resets the indention to 4 spaces, reducing the size of the final diff to just code changes and *minor* formatting differences, reducing the effect of indention.
2023-07-05 13:02:47 -05:00
aarondill 2d3c5bb677 add -s/--sudo option to choose the sudo command
The default is *not* programatically generated in the help menu, as we don't determine this until later. This is intentional, so we can validate the user's choice of command.
2023-07-05 13:00:46 -05:00
aarondill 213f69f408 move the "detected architecture: ..." message to *after* `parse_args`
This avoids logging the message when `--help` is specified, and helps ensure the correct output if `--arch` is specified
2023-07-05 12:51:22 -05:00
aarondill f1a54433a2 Add support for options in install script
This adds support for serveral new command line options (taken from the usage):
    "-b, --bin-dir" "Override the bin installation directory [default: ${_bin_dir}]" \
    "-m, --man-dir" "Override the man installation directory [default: ${_man_dir}]" \
    "-a, --arch" "Override the architecture identified by the installer [default: ${_arch}]" \
    "-h, --help" "Display this help message"
This also (coincidentally) allows for $BIN_DIR, $MAN_DIR, and $ARCH to be set to create default settings for these.
These variables are *always* overwritten by the command line arguments.

This diff is unusually large, as my formatter ([shfmt](https://github.com/mvdan/sh)) ran, reformatting the majority of the script.

This also adds a few utilities to the script (`log`/`abort`) and modifies `err` to simply output to stderr.
This allows for more fine grain control over script flow and output, without relying on `echo >&2`.
2023-07-05 12:48:58 -05:00
Ajeet D'Souza 0ecfbf7e68 Format + lint more filetypes 2023-05-06 14:25:33 +05:30
Ajeet D'Souza 03df9d4d1f Update install script to support Windows 2023-04-30 15:05:51 +05:30
Ajeet D'Souza 2555870c31 Handle rate limits in installer 2023-01-08 05:21:00 +05:30
Ajeet D'Souza 209d86ab2f
Install script for zoxide (#425) 2022-07-15 07:30:48 +05:30
Ajeet D'Souza a285b4e07d Release v0.7.0 2021-05-02 06:03:51 +05:30
Adam Stephens 90f49684e9
add armv7/aarch64 support to installer (#198) 2021-05-01 01:02:20 +05:30
Ajeet D'Souza bc0ca7b82c Release v0.4.1 2020-05-25 02:55:00 +05:30
Ajeet D'Souza 8b5bcee3e6 Make install.sh executable 2020-03-08 08:37:11 +05:30
Kartik Sharma bc65fc8534 Added install script to install zoxide with cross-compatibility in a one-liner format. 2020-03-08 00:13:45 +05:30