-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config-helper: fix edge cases #250
Conversation
- replace rg/sd/teip combo with new `echo-regexp` that uses deno - use new `fs-diff` for showing diffs based on multi strategy - add new styling - enable deno in vscode todos: - fix tests - remove lingering sd/rg/teip references
77a5358
to
1a385f0
Compare
- config-helper: instead of removing a line by replacing it with its indentation, it is now removed, as per the prior expectation - add `echo-escape-backslashes` and remove it from `echo-escape-regexp-replacement` for compat with JavaScript Regular Expressions - update some `bash.bash` deprecations - bash.bash: add explicit names for `__print*` helpers, and slightly change their functionality to be aligned with expectations
1a385f0
to
6860035
Compare
There's a few strange edge cases that I'm not sure on what solution I should go with. The main one is whether config-helper should remove lines, as it did before, or only replace lines (with empty/indented line if removing). I originally had the rewrite do empty/indented replacements, but then that caused the tests to fail, so then I rewrote it for removals as it was before, however tests are now sporadic and I'm not sure if it is actually better in hindsight. I think I will just go back to the simpler and more obvious replacements and just update the tests accordingly. I will evaluate this again after I have more progress on the below. I believe the new echo-regexp should be able to replace all gsed, sed, grep, ripgrep, and sd usage throughout Dorothy, which will bring complexity of the codebase down, use only a single regex syntax rather than the current three, and require less upfront dependencies to be installed (only jq and deno). I'm currently rewriting everything to use echo-regexp and expanding echo-regexp to support these wider use cases. Additionally I am adding tests for all modified commands. This is taking longer than expected, but is such a relief as progress is made due to the reduction of complexity. |
- `__print_line ...` to `__print_lines ...` - `command-(missing|working|exists) ...` to `-- ...` - add tests to `echo-magent-hash`, ` - `dorothy` minimum deps now only `jq` and `deno` - `down`: add `--url=...` support - `echo-regexp(.ts)`: add `-qvf` support, improve performance, change `--multiline-dotall` to `s` flag - `fs-(bytes|kilobytes|megabytes)`: use `dust` instead of `du` to achieve macos support, also fix crash in `fs-megabytes` - `get-filesystem`: no longer fail silently when no args are provided - `get-local-to-remote`: improve styling - `styles.bash` make code styles more readable on light theme, by swapping from dim to intense black - `get-opensuse-release`: simpler technique - `get-url-(domain|protocol)` split into `get-url-(domain|protocol).ts` and add tests - `what-is-my-(dns|gateway|inteface|ip|subnet)`: rewrote and fixed - `get-codec`: rewrote and fixed Requires more testing on: - `get-devices` - `mount-helper` - `get-volumes` - `git-helper` - `gpg-helper` - `setup-util-nerd-fonts` - `setup-util-node` - `unziptar` on DMG files - `itunes-owners` - `setup-server New deprecations: - `is-match` replaced by `echo-regexp -q`
23071c5
to
0e02dc9
Compare
ef18c2a
to
b91656b
Compare
…perm issues, so let's see if --classic does /ref https://github.com/bevry/dorothy/actions/runs/10868987073
6b048ca
to
6838a37
Compare
9b33b0c
to
38a6fc9
Compare
38a6fc9
to
d334b8f
Compare
- move awk scripts to .awk for bash v3 compat - config-helper: swap `?s:` with `[\s\S]` for old deno compat - sparse-vault: fix broken awk script, use `echo-regexp` instead /ref https://github.com/bevry/dorothy/actions/runs/10875982538/job/30175251360
85b9f9d
to
ee85edf
Compare
this now allows tool selection and prompting, as well as testing each tool, for: - echo-html-coder - echo-url-coder - echo-math /ref https://github.com/bevry/dorothy/actions/runs/10877091411/job/30177948850
ee85edf
to
62d42ca
Compare
config-helper: restore outputting config was updated line to stderr echo-lines: support --quote flag
Still got some some failures on macos with bash v3 Edit: couldn't reproduce locally... will re-run them |
- ask, choose: use echo-wrap in arg form, no need for pipe - get-devices, get-local-to-remote: fix echo-regexp regression, and fix sporadic nature of success which was due to missing `--stdin` - bash.bash: simplify eval statements and support spaces in paths
/close #249 #241 #239 changes: - replace common gsed/sed/sd/ripgrep/rg/grep/teip usage with new `echo-regexp` that uses deno, affects `convert-helper`, `config-helper`, `echo-magnet-hash`, `fs-(bytes|kilobytes|megabytes)`, `fs-speed`, `get-devices`, `get-local-to-remote`, `get-opensuse-release`, `get-volumes`, `git-helper`, `is-bash-version-outdated`, `mount-helper`, `network-interface`, `setup-dns`, `setup-util`, `setup-util-1password-cli`, `setup-util-nerd-fonts`, `setup-util-node`, `unziptar`, `what-is-my-(dns|gateway|interface|ip|submit)`, `get-codec`, `is-prefix`, `is-suffix`, `itunes-owners`, `mac-address-helper`, `setup-server` - `bash.bash`: - simplify eval statements and support spaces in paths - add explicit names for `__print*` helpers, and slightly change their functionality to be aligned with expectations - **please change `__print_line ...` to `__print_lines ...` as in the future `__print_line` may not support arguments** - **removed deprecated non `__` prefixed aliases, e.g. `require_globstar` is now only `__require_globstar`** - `ci/dorothy-workflow`: don't test PRs until review requested - `ci/dorothy`: don't eslint as no Node.js code - `ci/vscode`: add an awk syntax highlighting extension, and enable Deno - `command-working`: give details of failures, add `dash` to exceptions - `dorothy-config`/`config-helper`: significant work to better handle multiple instances (result is no longer garbled), output and process is now clearer, includes multiple strategies for multiple instances, uses new `echo-regexp` to replace `sd/rg/teip/grep` combo - `dorothy` minimum deps now only `jq` and `deno`s, - `down`: add `--url=...` support - `echo-gnu-command`: fix it not outputting the command after installation - `echo-if-empty`/`get-devices`/`get-local-to-remote`: fix sporadic success by adding missing `--stdin` - `echo-lines`: now support `--[no-]quote` flags as alias for prior `--[no-]quoted` flag - `echo-math`/`echo-(html|url)-(encode|decode)`: rewrote and added tests, now they work correctly, in the latter case `echo-(html|url)-coder` is now used - `echo-wrap`: now awk compatible, removing dependency on `gawk` - `eval-tester`: output escaped comparison if special characters were used - `fs-(bytes|kilobytes|megabytes)`: use `dust` instead of `du` to achieve macos support, also fix crash in `fs-megabytes` - `fs-rm`: fix trash error on alpine, as trash isn't available on alpine - `get-codec`: removed `--trim` and made it default (prior verbosity available via `--verbose`), now sensible error if `ffprobe` is not available - `get-codec`: rewrote and fixed - `get-filesystem`: no longer fail silently when no args are provided - `get-local-to-remote`: improve styling - `get-opensuse-release`: simpler technique - `get-url-(domain|protocol)` split into `get-url-(domain|protocol).ts` and add tests - `is-match`: deprecated and moved in beta commands, as it is replaced by `echo-regexp -q` which it now uses internally - `mac-address-helper`: fixed broken `new` functionality, and improved formatting of outputs - `set-hostname`/`setup-hosts`/`setup-shell`: fix break when gsed isn't available, now uses the `echo-gnu-command` helper - `setup-util-1password`: install stable instead of beta, as stable is now stable - `setup-util-deno`: add apk, uninstall snap (as snap does not allow script execution), use official arm builds as that is now a thing, don't use official yet stupid `deno_install` script - `setup-util-devel`: add `automake` for macos - `setup-util-gawk`: add more package systems - `setup-util-gsed`: add bottles for macos, and add uninstall build support - `setup-util`: rename `DOWNLOAD_BUILD_EVAL` to `DOWNLOAD_BUILD_INSTALL` and add `DOWNLOAD_BUILD_UNINSTALL`, affected `setup-util-bash`, `setup-util-gawk`, `setup-util-gsed` - `sparse-vault`: fix broken awk script, use `echo-regexp` instead - `sparse-vault`: fix broken macos version fetching - `styles.bash` make code styles more readable on light theme by swapping from dim to intense black, add code error, info, and notice styles - `unziptar`: fix alpine compatibility - `what-is-my-(dns|gateway|inteface|ip|subnet)`: rewrote and fixed - add `.gitattributes` to prevent formatting issues in tests - add `echo-escape-backslashes` and remove its functionality from `echo-escape-regexp-replacement` for compat with JavaScript Regular Expression - add `fs-diff` to compute differences between files - add `get-file` and `setup-util-file` to fix `unziptar` compat on systems without `file` preinstalled - add `setup-util-frawk` - add tests to `echo-math`, `echo-(html|url)-(coder|encode|decode)`, `echo-magnet-hash`, `fs-(bytes|kilobytes|megabytes)`, `get-url-(domain|protocol)` needs more testing: - `get-opensuse-release` - `mount-helper` - `setup-dns` - `setup-server` - `setup-util-gsed` on fresh macos - `unziptar` on macos dmg files squashes: - be4b3ce - ada62e0 - 6860035 - d86e060 - 2b24208 - 1fdae98 - 4506b7f - 6618689 - 7022dba - fe5050b - 0e02dc9 - 7c7265d - bb507bd - 818d5c0 - b91656b - 96d91bc - 6838a37 - 7c7ed59 - a1f96ea - 2e4d9da - e2294c4 - 2a83b20 - da3cf12 - d334b8f - 86de699 - 35593fe - 62d42ca - c723ea2 - e68e2e0 - 7deab4e - ecee164 - 7cc4031 - e035a22 - e9a955a
merged into the amended 7ee7f6c instead as I forgot to remove the |
/close #249 #241 #239
changes:
echo-regexp
that uses deno, affectsconvert-helper
,config-helper
,echo-magnet-hash
,fs-(bytes|kilobytes|megabytes)
,fs-speed
,get-devices
,get-local-to-remote
,get-opensuse-release
,get-volumes
,git-helper
,is-bash-version-outdated
,mount-helper
,network-interface
,setup-dns
,setup-util
,setup-util-1password-cli
,setup-util-nerd-fonts
,setup-util-node
,unziptar
,what-is-my-(dns|gateway|interface|ip|submit)
,get-codec
,is-prefix
,is-suffix
,itunes-owners
,mac-address-helper
,setup-server
bash.bash
:__print*
helpers, and slightly change their functionality to be aligned with expectations__print_line ...
to__print_lines ...
as in the future__print_line
may not support arguments__
prefixed aliases, e.g.require_globstar
is now only__require_globstar
ci/dorothy-workflow
: don't test PRs until review requestedci/dorothy
: don't eslint as no Node.js codeci/vscode
: add an awk syntax highlighting extension, and enable Denocommand-working
: give details of failures, adddash
to exceptionsdorothy-config
/config-helper
: significant work to better handle multiple instances (result is no longer garbled), output and process is now clearer, includes multiple strategies for multiple instances, uses newecho-regexp
to replacesd/rg/teip/grep
combodorothy
minimum deps now onlyjq
anddeno
s,down
: add--url=...
supportecho-gnu-command
: fix it not outputting the command after installationecho-if-empty
/get-devices
/get-local-to-remote
: fix sporadic success by adding missing--stdin
echo-lines
: now support--[no-]quote
flags as alias for prior--[no-]quoted
flagecho-math
/echo-(html|url)-(encode|decode)
: rewrote and added tests, now they work correctly, in the latter caseecho-(html|url)-coder
is now usedecho-wrap
: now awk compatible, removing dependency ongawk
eval-tester
: output escaped comparison if special characters were usedfs-(bytes|kilobytes|megabytes)
: usedust
instead ofdu
to achieve macos support, also fix crash infs-megabytes
fs-rm
: fix trash error on alpine, as trash isn't available on alpineget-codec
: removed--trim
and made it default (prior verbosity available via--verbose
), now sensible error ifffprobe
is not availableget-codec
: rewrote and fixedget-filesystem
: no longer fail silently when no args are providedget-local-to-remote
: improve stylingget-opensuse-release
: simpler techniqueget-url-(domain|protocol)
split intoget-url-(domain|protocol).ts
and add testsis-match
: deprecated and moved in beta commands, as it is replaced byecho-regexp -q
which it now uses internallymac-address-helper
: fixed brokennew
functionality, and improved formatting of outputsset-hostname
/setup-hosts
/setup-shell
: fix break when gsed isn't available, now uses theecho-gnu-command
helpersetup-util-1password
: install stable instead of beta, as stable is now stablesetup-util-deno
: add apk, uninstall snap (as snap does not allow script execution), use official arm builds as that is now a thing, don't use official yet stupiddeno_install
scriptsetup-util-devel
: addautomake
for macossetup-util-gawk
: add more package systemssetup-util-gsed
: add bottles for macos, and add uninstall build supportsetup-util
: renameDOWNLOAD_BUILD_EVAL
toDOWNLOAD_BUILD_INSTALL
and addDOWNLOAD_BUILD_UNINSTALL
, affectedsetup-util-bash
,setup-util-gawk
,setup-util-gsed
sparse-vault
: fix broken awk script, useecho-regexp
insteadsparse-vault
: fix broken macos version fetchingstyles.bash
make code styles more readable on light theme by swapping from dim to intense black, add code error, info, and notice stylesunziptar
: fix alpine compatibilitywhat-is-my-(dns|gateway|inteface|ip|subnet)
: rewrote and fixed.gitattributes
to prevent formatting issues in testsecho-escape-backslashes
and remove its functionality fromecho-escape-regexp-replacement
for compat with JavaScript Regular Expressionfs-diff
to compute differences between filesget-file
andsetup-util-file
to fixunziptar
compat on systems withoutfile
preinstalledsetup-util-frawk
echo-math
,echo-(html|url)-(coder|encode|decode)
,echo-magnet-hash
,fs-(bytes|kilobytes|megabytes)
,get-url-(domain|protocol)
needs more testing:
get-opensuse-release
mount-helper
setup-dns
setup-server
setup-util-gsed
on fresh macosunziptar
on macos dmg filessquashes: