From fcb91bfc66e34e66992275c948ef3419234c30bc Mon Sep 17 00:00:00 2001 From: bmacnaughton Date: Tue, 28 Nov 2023 20:10:50 -0800 Subject: [PATCH] give it a try --- test/basics.test.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/basics.test.js b/test/basics.test.js index 2c62947..c0bd49f 100644 --- a/test/basics.test.js +++ b/test/basics.test.js @@ -344,12 +344,17 @@ function getCommonFormatUx(rootdir) { // rearranged to match the common format. const re = new RegExp('^(\\d+) (.).{9} ' + '(.+)$'); + let cmd = 'stat --format "%s %A %n"'; + if (os.type() === 'Darwin') { + cmd = 'stat -f "%z %Sp %SN"' + } + // `find node_modules/.bin -exec stat --printf "%s %A" {} ';' -exec echo " "{} ';'` // 4096 drwxr-xr-x test // 6644 -rw-r--r-- test/index.test.js // and we convert to "4096 test d" and "6644 test/index.test.js f" so common processing // with results of the file-sizes.ps1 script. - const r = cp.execSync(`find ${rootdir} -exec stat --format "%s %A %n" {} ';'`); + const r = cp.execSync(`find ${rootdir} -exec ${cmd} {} ';'`); const lines = r.toString().split('\n'); const items = []; for (const line of lines) {