Skip to content

Commit

Permalink
give it a try
Browse files Browse the repository at this point in the history
  • Loading branch information
bmacnaughton committed Nov 29, 2023
1 parent 555f4b4 commit fcb91bf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/basics.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit fcb91bf

Please sign in to comment.