File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ section "Codex log size"
186186if [ -d " $HOME /.codex" ]; then
187187 while IFS= read -r log_path; do
188188 [ -n " $log_path " ] || continue
189- log_size=" $( stat -f ' %z ' " $log_path " 2> /dev/null || printf 0) "
189+ log_size=" $( size_of " $log_path " 2> /dev/null || printf 0) "
190190 if [ " $log_size " -ge 524288000 ]; then
191191 fail_check " $log_path is larger than 500 MB"
192192 elif [ " $log_size " -ge 209715200 ]; then
Original file line number Diff line number Diff line change @@ -35,13 +35,32 @@ json_string() {
3535}
3636
3737mode_of () {
38+ if stat -c ' %a' " $1 " > /dev/null 2>&1 ; then
39+ stat -c ' %a' " $1 "
40+ return
41+ fi
42+
3843 stat -f ' %Lp' " $1 "
3944}
4045
4146owner_of () {
47+ if stat -c ' %U' " $1 " > /dev/null 2>&1 ; then
48+ stat -c ' %U' " $1 "
49+ return
50+ fi
51+
4252 stat -f ' %Su' " $1 "
4353}
4454
55+ size_of () {
56+ if stat -c ' %s' " $1 " > /dev/null 2>&1 ; then
57+ stat -c ' %s' " $1 "
58+ return
59+ fi
60+
61+ stat -f ' %z' " $1 "
62+ }
63+
4564check_mode_any () {
4665 local missing_severity=" $1 "
4766 local path=" $2 "
Original file line number Diff line number Diff line change @@ -48,3 +48,12 @@ infisical_mint_machine_token() {
4848 --plain \
4949 --silent
5050}
51+
52+ infisical_file_mode () {
53+ if stat -c ' %a' " $1 " > /dev/null 2>&1 ; then
54+ stat -c ' %a' " $1 "
55+ return
56+ fi
57+
58+ stat -f ' %Lp' " $1 "
59+ }
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ fail() {
2424}
2525
2626mode_of () {
27- stat -f ' %Lp ' " $1 "
27+ infisical_file_mode " $1 "
2828}
2929
3030quote_assignment () {
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ fail() {
2424}
2525
2626mode_of () {
27- stat -f ' %Lp ' " $1 "
27+ infisical_file_mode " $1 "
2828}
2929
3030load_required_config () {
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ fail() {
4949}
5050
5151mode_of () {
52- stat -f ' %Lp ' " $1 "
52+ infisical_file_mode " $1 "
5353}
5454
5555owner_of () {
You can’t perform that action at this time.
0 commit comments