You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- `bash.bash:__do`:
- fix `--redirect-stdout`, it was appending the creating FD instead of forwarding to it
- `fs-own`:
- fix elevation not working
- support `--changes` on macos (need to test implications on alpine)
- support `-...` instead of just `--...` (still doesn't support combing `-...`)
- correctly send `chown`/`chmod` output to STDERR
- `symlink-helper`:
- ignore broken symlinks if they still point to the intended location
- colorise formatting on existing symlinks
- `eval-helper`:
- don't mkdir root home, as it is not necessary (might be different on non-macos envuronments)
- if needing to make home, perform the normal elevate flow on the home creation, so the user knows why they are being prompted for their password
- if the home making fails, attempt to continue without home
Claim ownership of a path, by updating its permissions via chmod and chown.
73
70
74
71
USAGE:
75
-
fs-own [...options] [--] ...<path>
72
+
fs-own [...options] -- ...<path>
76
73
77
74
EXAMPLE:
78
75
fs-own --recursive --ug -- .
79
76
80
77
OPTIONS:
81
78
--quiet | --verbose | --changes
82
-
if --verbose, apply --changes if supported and use --verbose on executed chmod/chown commands.
83
-
if --quiet, apply --no-changes
84
-
if neither --verbose or --quiet then apply --changes if supported
79
+
if [--changes], the default, only output to STDERR the changes
80
+
if [--verbose], output to STDERR all operations
85
81
86
-
--X
82
+
--X | -X
87
83
sets <permissions> to be executable directories for the user: +x
88
-
--x
84
+
--x | -x
89
85
sets <permissions> to be executable for the user: +x
90
-
--r
86
+
--r | -r
91
87
sets <permissions> to be executable for the user: +r
92
-
--w
88
+
--w | -w
93
89
sets <permissions> to be executable for the user: +w
94
-
--u
90
+
--u | -u
95
91
sets <permissions> to only be available to the user: a-xrw,u+Xrw
96
-
--ux
92
+
--ux | -ux
97
93
sets <permissions> to only be available and executable to the user: a-xrw,u+xrw
98
-
--ug
94
+
--ug | -ug
99
95
sets <permissions> to only be available to the user and group: a-xrw,ug+Xrw
100
-
--ugx
96
+
--ugx | -ugx
101
97
sets <permissions> to only be available and executable to the user and group: a-xrw,ug+xrw
102
98
--permissions=<permissions>
103
99
sets file and directory permissions.
@@ -204,43 +200,43 @@ function fs_own() (
204
200
fi
205
201
option_permissions='+X'
206
202
;;
207
-
'--x')
203
+
'--x' | '-x')
208
204
if [[ -n$option_permissions ]];then
209
205
help"$item cannot be specified with other <permissions>"
210
206
fi
211
207
option_permissions='+x'
212
208
;;
213
-
'--r')
209
+
'--r' | '-r')
214
210
if [[ -n$option_permissions ]];then
215
211
help"$item cannot be specified with other <permissions>"
216
212
fi
217
213
option_permissions='+r'
218
214
;;
219
-
'--w')
215
+
'--w' | '-w')
220
216
if [[ -n$option_permissions ]];then
221
217
help"$item cannot be specified with other <permissions>"
222
218
fi
223
219
option_permissions='+w'
224
220
;;
225
-
'--u')
221
+
'--u' | '-u')
226
222
if [[ -n$option_permissions ]];then
227
223
help"$item cannot be specified with other <permissions>"
228
224
fi
229
225
option_permissions='a-xrw,u+Xrw'
230
226
;;
231
-
'--ux')
227
+
'--ux' | '-ux')
232
228
if [[ -n$option_permissions ]];then
233
229
help"$item cannot be specified with other <permissions>"
234
230
fi
235
231
option_permissions='a-xrw,u+xrw'
236
232
;;
237
-
'--ug')
233
+
'--ug' | '-ug')
238
234
if [[ -n$option_permissions ]];then
239
235
help"$item cannot be specified with other <permissions>"
240
236
fi
241
237
option_permissions='a-xrw,ug+Xrw'
242
238
;;
243
-
'--ugx')
239
+
'--ugx' | '-ugx')
244
240
if [[ -n$option_permissions ]];then
245
241
help"$item cannot be specified with other <permissions>"
246
242
fi
@@ -264,7 +260,7 @@ function fs_own() (
264
260
break
265
261
;;
266
262
'--'*) help"An unrecognised flag was provided: $item" ;;
267
-
*) option_paths+=("$item") ;;
263
+
*) help"An unrecognised argument was provided: $item" ;;
268
264
esac
269
265
done
270
266
@@ -392,32 +388,41 @@ function fs_own() (
392
388
fi
393
389
394
390
# adjustments: changes, quiet, verbose
395
-
if [[ -z$option_changes ]];then
396
-
if [[ $option_quiet=='yes' ]];then
397
-
option_changes='no'
391
+
function__filter_changes {
392
+
cat
393
+
}
394
+
if [[ $option_quiet=='no' ]];then
395
+
if is-mac;then
396
+
# Reports even if there are no changes.
397
+
# -v: Cause chown to be verbose, showing files as the owner is modified. If the -v flag is specified more than once, chown will print the filename, followed by the old and new numeric user/group ID.
398
+
# -v: Cause chmod to be verbose, showing filenames as the mode is modified. If the -v flag is specified more than once, the old and new modes of the file will also be printed, in both octal and symbolic notation.
399
+
ch_args+=('-vv')
398
400
else
399
-
# neither --quiet/--verbose, or just --verbose
400
-
# in which case, enable changes if supported
401
-
if is-mac || is-alpine;then
402
-
option_changes='no'
403
-
else
404
-
option_changes='yes'
405
-
fi
401
+
# -v, --verbose: output a diagnostic for every file processed
402
+
ch_args+=('--verbose')
406
403
fi
407
-
elif [[ $option_changes=='yes' ]];then
404
+
elif [[ $option_changes!='no' ]];then
408
405
if is-mac || is-alpine;then
409
-
echo-style --stderr --dim='Reporting permission changes is not provided by this Operating System.'
0 commit comments