Skip to content

Commit c2347f2

Browse files
committed
Address issues with stale TMPDIR with phpcs
1 parent d2dbfdb commit c2347f2

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

justfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ build-wp-org:
2323
nix build .#pluginWpOrg
2424

2525
# Run tests and other checks
26-
check: _check_no_test test
26+
check: _ensure-tmpdir _check_no_test test
27+
28+
# Sometimes editors get a stale TMPDIR.
29+
30+
# This prevents issues with the dir not existing.
31+
_ensure-tmpdir:
32+
@[ -z "${TMPDIR:-}" ] || mkdir -p "$TMPDIR"
2733

2834
_nix-system:
2935
@nix eval --impure --raw --expr 'builtins.currentSystem'
@@ -50,7 +56,7 @@ dev CLEAN="false" DEBUG="false":
5056
{{ if DEBUG == "true" { "ENABLE_XDEBUG=true nix run . --impure -- --no-server" } else { "nix run . -- --no-server" } }}
5157

5258
# Format source and then check for unfixable issues
53-
format: && _format-php
59+
format: _ensure-tmpdir && _format-php
5460
just --fmt --unstable
5561
fd -e json -x jsonfmt -w
5662
fd -e nix -x nixfmt
@@ -95,7 +101,7 @@ svn-update:
95101
svn up "{{ svn_dir }}"
96102

97103
# Validate and run tests in a sandbox
98-
test: _validate _phpcs _test-integration
104+
test: _ensure-tmpdir _validate _phpcs _test-integration
99105

100106
# Run integration tests in a sandbox
101107
_test-integration:

0 commit comments

Comments
 (0)