Skip to content

Commit 62953da

Browse files
committed
Streamline condition wrapping
1 parent be1051f commit 62953da

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

hooks/_common.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,7 @@ function common::get_cpu_num {
209209
local wslinterop_path="/proc/sys/fs/binfmt_misc/WSLInterop"
210210

211211
if [[ -f /sys/fs/cgroup/cpu/cpu.cfs_quota_us &&
212-
(
213-
! -f "${wslinterop_path}" &&
214-
! -f "${wslinterop_path}-late") ]] \
215-
; then # WSL has cfs_quota_us, but WSL should be checked as usual Linux host
212+
(! -f "${wslinterop_path}" && ! -f "${wslinterop_path}-late") ]]; then # WSL has cfs_quota_us, but WSL should be checked as usual Linux host
216213
# Inside K8s pod or DinD in K8s
217214
cpu_quota=$(< /sys/fs/cgroup/cpu/cpu.cfs_quota_us)
218215
cpu_period=$(cat /sys/fs/cgroup/cpu/cpu.cfs_period_us 2> /dev/null || echo "$cpu_quota")

0 commit comments

Comments
 (0)