Commit Graph

441 Commits

Author SHA1 Message Date
aarondill e011abae7b add brackets to variables to pass lint
The CI shellcheck linter requires brackets on variables, so this commit adds them
2023-07-05 14:05:53 -05:00
aarondill 98bf021db9 handle slashes at end of _bin_dir
*usually*, $PATH will *not* contain trailing slashes, while _bin_dir may or may not. This changes the case statement to test for `_bin_dir`, `_bin_dir/`, and `_bin_dir` without a trailing slash.
This reduces false positives and unnecessary logs
2023-07-05 14:02:26 -05:00
aarondill dff0050a5e fix typo `/man1}` -> `/man1`
This was causing the script to always use sudo privilages if `/man1` already exists
2023-07-05 13:57:11 -05:00
aarondill 68b22402c9 FIX: SUDO: parameter not set
SUDO may not be set, if no parameter or environment variable is passed. This ensures that elevate_priv gets an empty string (as expected) in those cases
2023-07-05 13:53:45 -05:00
aarondill 7d1454e430 handle _man_dir writabililty more robustly
This ensures that mismatched permissions/ownership on `${_man_dir}` and `${_man_dir}/man1` don't cause the script to fail.

*If* `${man_dir}/man1` already exists and is writable, OR `${_man_dir}/man1` *doesn't* yet exist, but `${_man_dir}` is
writable, then the script continues without sudo.

If `/man1` doesn't exist, and it's parent isn't writable, we need sudo.
If `/man1` *does* exist, and it's not writable, we need sudo.
2023-07-05 13:52:17 -05:00
aarondill b92ff0489e reset `$sudo` when writing man pages.
This helps ensure that mismatched permission on `_bin_dir` and `_man_dir` don't cause issues.
Also prevents creating man pages owned by root being written to the user's $HOME
2023-07-05 13:39:33 -05:00
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
dependabot[bot] 72a49ec9c9
Bump Swatinem/rust-cache from 2.5.0 to 2.5.1 (#588)
Bumps [Swatinem/rust-cache](https://github.com/swatinem/rust-cache) from 2.5.0 to 2.5.1.
- [Release notes](https://github.com/swatinem/rust-cache/releases)
- [Changelog](https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md)
- [Commits](https://github.com/swatinem/rust-cache/compare/v2.5.0...v2.5.1)

---
updated-dependencies:
- dependency-name: Swatinem/rust-cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-04 00:29:10 +05:30
Ajeet D'Souza 651fc3c00e Fix CI 2023-07-03 21:01:55 +05:30
JT 786519aa8f
Update nushell env update syntax (#587) 2023-07-01 01:01:08 +05:30
Ajeet D'Souza 5f8974fc5c
Add aerc under third-party integrations 2023-06-26 13:58:15 +05:30
dependabot[bot] 03c465b778
Bump cachix/install-nix-action from 21 to 22 (#585)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 21 to 22.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v21...v22)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-20 01:50:58 +05:30
dependabot[bot] 469b858278
Bump Swatinem/rust-cache from 2.4.0 to 2.5.0 (#584)
Bumps [Swatinem/rust-cache](https://github.com/Swatinem/rust-cache) from 2.4.0 to 2.5.0.
- [Release notes](https://github.com/Swatinem/rust-cache/releases)
- [Changelog](https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Swatinem/rust-cache/compare/v2.4.0...v2.5.0)

---
updated-dependencies:
- dependency-name: Swatinem/rust-cache
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-20 01:48:51 +05:30
hyperpuncher e938034423
fix link to arch repo (#583)
* fix link to arch repo

Community packages were merged to extra.

* fix link title

* fix link title
2023-06-18 12:02:36 +05:30
Ajeet D'Souza 6dedfcd74a Update clap 2023-06-11 01:08:07 +05:30
Ajeet D'Souza 49e7824c42
Fix CI 2023-06-07 07:27:46 +05:30
mataha 157b221055
Remove underlined text artifacts on Windows (#581) 2023-06-07 07:17:20 +05:30
dependabot[bot] 1d64ae0b87
Bump cachix/install-nix-action from 20 to 21 (#578)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 20 to 21.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v20...v21)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-30 01:17:59 +05:30
dependabot[bot] 25b4c057fb
Bump Swatinem/rust-cache from 2.3.0 to 2.4.0 (#575)
Bumps [Swatinem/rust-cache](https://github.com/Swatinem/rust-cache) from 2.3.0 to 2.4.0.
- [Release notes](https://github.com/Swatinem/rust-cache/releases)
- [Changelog](https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Swatinem/rust-cache/compare/v2.3.0...v2.4.0)

---
updated-dependencies:
- dependency-name: Swatinem/rust-cache
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 09:52:38 +05:30
dependabot[bot] c6ab1012e4
Bump Swatinem/rust-cache from 1.0.2 to 2.3.0 (#572)
Bumps [Swatinem/rust-cache](https://github.com/Swatinem/rust-cache) from 1.0.2 to 2.3.0.
- [Release notes](https://github.com/Swatinem/rust-cache/releases)
- [Changelog](https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Swatinem/rust-cache/compare/v1.0.2...v2.3.0)

---
updated-dependencies:
- dependency-name: Swatinem/rust-cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-16 04:13:28 +05:30
Ajeet D'Souza 153e060043 Add short option -a for --all 2023-05-09 00:51:26 +05:30
Ajeet D'Souza e05637ded1 Improve clarity of setup instructions 2023-05-08 22:40:04 +05:30
Ajeet D'Souza ce8f2395d5 Job-level permission for action 2023-05-07 23:48:30 +05:30
sitiom 54e9f9aa7a
Add Winget Releaser workflow (#532) 2023-05-07 22:47:02 +05:30
Ajeet D'Souza 686d116ad5 chore(release): v0.9.1 2023-05-07 21:07:00 +05:30
Ajeet D'Souza 21211e43d1 Add DeepSource 2023-05-07 19:54:24 +05:30
deepsource-io[bot] 3483ab013a
ci: Update .deepsource.toml 2023-05-07 14:00:34 +00:00
Ajeet D'Souza 74ccc0232f
Support for PWD hooks on all versions of PowerShell (#563) 2023-05-07 19:19:53 +05:30
Ajeet D'Souza 0ecfbf7e68 Format + lint more filetypes 2023-05-06 14:25:33 +05:30
Ajeet D'Souza 0b51cb6591
Improve completions (#562) 2023-05-06 20:48:19 +05:30
Ajeet D'Souza 5de13befbc Replace xtask with justfile 2023-05-06 03:55:18 +05:30
Ajeet D'Souza a7c8231e56 Update GitHub Actions 2023-05-05 13:24:44 +05:30
Ajeet D'Souza 03df9d4d1f Update install script to support Windows 2023-04-30 15:05:51 +05:30
Ajeet D'Souza 56956779b2 Consistent style for environment variables 2023-04-16 19:54:55 +05:30
Ajeet D'Souza 4dff2b1602 Add support for older Fish versions 2023-04-15 00:08:16 +05:30
Lily Mara 4f475a75cb
Nushell: use new lambda syntax 2023-04-15 00:05:05 +05:30
StepSecurity Bot fa1cfb490d Harden GitHub Actions (#544)
* Harden GitHub Actions

* Update release.yml

---------

Co-authored-by: Ajeet D'Souza <98ajeet@gmail.com>
2023-03-19 15:20:22 +05:30
Josh Medeski 8f1cb75732 docs: add t to third-party integrations (#537) 2023-03-01 14:15:46 +05:30
Ajeet D'Souza 39f5aaa308 Formatting 2023-03-01 13:55:22 +05:30
Ajeet D'Souza 3c8a0d6b13 Add alias for `import --from=fasd` 2023-02-18 10:55:45 +05:30
sitiom 4ded81e277
Add Winget installation in the README (#530)
Co-authored-by: Ajeet D'Souza <98ajeet@gmail.com>
2023-01-31 10:37:50 +05:30
Ajeet D'Souza 7299e33a80 Update README 2023-01-27 00:02:24 +05:30