Skip to content

Commit dc34c38

Browse files
committed
Merge branch 'dev/broken-symlinks'
* dev/broken-symlinks: (50 commits) ci: lint fs-link: correct some clearly bad logic fs-trim: adjust for new `fs-path` fs-move: adjust for new `fs-path` api fs-path: fix two bugs fs-path: continue cleanup fs-path: continue `--absolute` implementation WIP: fs-path: use `--absolute=...` styles.bash: add text sizes fs-path: happy with this help fs-path: try to document api complexity fs-path.bash: remove unused var checksum: absolute and validate *: use `--follow` instead of `--resolve` fs-path.bash: fix follow macos broken links ci: fix wsl reporting failure if no failures fs-path: more macos fixes fs-path: fix test expectations for macos fs-path: note todos fs-path: new resolution algo ... Signed-off-by: Benjamin Lupton <b@lupton.cc>
2 parents 285b03a + 43b207e commit dc34c38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+5628
-3442
lines changed

.github/workflows/dorothy-workflow.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,9 @@ jobs:
294294
# Execute the script, with appropriate ENV varrs, and with some `setsid` magic so that WSL isn't interactive and TTY attached
295295
wsl.exe -- env GITHUB_TOKEN=$Env:GITHUB_TOKEN CI=true GITHUB_ACTIONS=$Env:GITHUB_ACTIONS GITHUB_STEP_SUMMARY=$summaryWSL bash -eo pipefail -c "(setsid $scriptPath) </dev/null |& cat"
296296
$scriptExitStatus = $LastExitCode
297-
# Append `GITHUB_STEP_SUMMARY` with the WSL generated summary
298-
Add-Content -Path $summaryHost -Value (Get-Content -Path $summaryFile)
299-
# Report and fail with the script's exit status
297+
# If the `wsl.exe` summary (`$summaryFile`) exists, then append to `GITHUB_STEP_SUMMARY` (`$summaryHost`)
298+
if (Test-Path -Path $summaryFile) { Add-Content -Path $summaryHost -Value (Get-Content -Path $summaryFile) }
299+
# Report and exit with the script's exit status
300300
$Host.SetShouldExit($scriptExitStatus) # This works around https://github.com/actions/runner/issues/351 and has GitHub Actions report the correct exit status
301301
Exit($scriptExitStatus)
302302
bash-versions-test:

commands.beta/echo-exit-affirmative

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function echo_exit_affirmative() (
2626
If provided, use this value when exit status is neither [0] or [1].
2727
2828
EXAMPLES:
29-
\`\`\`echo-exit-affirmative -- waiter 0 --status=0\`\`\`
29+
\`\`\`echo-exit-affirmative -- waiter 0\`\`\`
3030
Outputs: \`yes\`
3131
\`\`\`echo-exit-affirmative -- waiter 0 --status=1\`\`\`
3232
Outputs: \`no\`

commands.beta/echo-nothing-or-fail

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ function echo_nothing_or_fail_test() (
1313
printf '%s\n' 'sup' | eval-tester --status=1 -- \
1414
echo-nothing-or-fail --stdin
1515

16-
eval-tester --status=0 -- \
16+
eval-tester -- \
1717
echo-nothing-or-fail --
18-
true | eval-tester --status=0 -- \
18+
true | eval-tester -- \
1919
echo-nothing-or-fail --stdin
2020

2121
return 0

commands.beta/itunes-owners

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
function itunes_owners_test() (
55
source "$DOROTHY/sources/bash.bash"
6-
eval-tester --ignore-stderr --status=0 -- itunes-owners --help
6+
eval-tester --ignore-stderr -- itunes-owners --help
77
)
88

99
function itunes_owners() (

commands.beta/video-merge

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function video_merge() (
5656
--user=<user>
5757
--group=<group>
5858
--reason=<reason>
59-
Forwarded to \`is-file\`, \`fs-path --absolute\`, \`fs-remove\`, \`eval-helper\`.
59+
Forwarded to \`is-file\`, \`fs-path\`, \`fs-remove\`, \`eval-helper\`.
6060
6161
EXAMPLES:
6262
\`\`\`video-merge 'merged.m4v' -- 'input1.m4v' 'input2.m4v'\`\`\`

commands.deprecated/fs-dirname

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function fs_dirname() (
5858
Outputs: \`.\`
5959
\`\`\`fs-path --parents --absolute -- ./symlinked-directory\`\`\`
6060
Outputs: \`${parent_of_home}/${USER}\`
61-
\`\`\`fs-path --parents --resolve -- ./symlinked-directory\`\`\`
61+
\`\`\`fs-path --parents --follow -- ./symlinked-directory\`\`\`
6262
Outputs: \`${parent_of_home}\`
6363
EOF
6464
return 22 # EINVAL 22 Invalid argument

commands.deprecated/fs-realpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
function fs_realpath() (
44
source "$DOROTHY/sources/bash.bash"
5-
dorothy-warnings add --code='fs-realpath' --bold=' has been deprecated in favor of ' --code='fs-path --resolve'
5+
dorothy-warnings add --code='fs-realpath' --bold=' has been deprecated in favor of ' --code='fs-path --physical'
66

77
# =====================================
88
# Arguments

commands/checksum

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,12 @@ function checksum_() (
223223
--defaults-fuzzy="$(echo-lines --prefix='[' --suffix=']' -- "${option_algorithms[@]}")" -- "${algorithms[@]}"
224224
fi
225225

226-
# ensure all paths exist and are resolved to absolute
226+
# ensure all paths exist and are absolute
227227
if [[ ${#option_paths[@]} -ne 0 ]]; then
228-
# ensure paths are absolute
228+
# do not resolve, as directory checksums should compare subpaths and their data, not resolved paths and their data
229+
# such that two directories, with same subpaths and data should match, even if symlinks are different
229230
__split --target={option_paths} --no-zero-length --invoke -- \
230-
fs-path --absolute -- "${option_paths[@]}"
231+
fs-path --absolute --validate -- "${option_paths[@]}"
231232
# ensure pv for progress bars on large files
232233
# __command_required -- pv || return $?
233234
fi

commands/dorothy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ function dorothy_() (
967967
paths+=("$DOROTHY")
968968
fi
969969
if [[ -d "$DOROTHY/user" ]]; then
970-
paths+=("$(fs-path --resolve -- "$DOROTHY/user")")
970+
paths+=("$(fs-path --follow -- "$DOROTHY/user")") # @todo fs-path should have an option to output every resolution
971971
fi
972972
if [[ ${#paths[@]} -ne 0 ]]; then
973973
__print_lines 'Once you have restarted your terminal, you can delete Dorothy by removing the following paths:'

commands/echo-max

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function echo_max_test() (
44
source "$DOROTHY/sources/bash.bash"
55
eval-tester --ignore-stderr --status=22 -- echo-max --help
66

7-
eval-tester --status=0 -- \
7+
eval-tester -- \
88
echo-max --
99

1010
eval-tester --stderr='ERROR: __maximum: The value must be an integer, it was: a' --status=22 -- \

0 commit comments

Comments
 (0)