mirror of
https://github.com/github/codeql-action
synced 2026-05-25 15:00:36 +03:00
Add telemetry for TRAP caching
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const getSize = require('../');
|
||||
const argv = require('gar')(process.argv.slice(2));
|
||||
const path = require('path');
|
||||
// --folder or -f or last argument passed
|
||||
const folder = argv.folder || argv.f || argv._[argv._.length - 1];
|
||||
|
||||
if (!folder) {
|
||||
console.error('missing folder argument');
|
||||
console.error('\n Usage:\n');
|
||||
console.error('get-folder-size --folder=/home/alex/www');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const ignore = argv.ignore ? new RegExp(argv.ignore) : null;
|
||||
|
||||
getSize(path.resolve(folder), ignore, (err, bytes) => {
|
||||
if (err) { throw err; }
|
||||
|
||||
console.log((bytes / 1024 / 1024).toFixed(2) + ' Mb');
|
||||
});
|
||||
Reference in New Issue
Block a user