-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
448 additions
and
353 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,7 @@ permissions: | |
security-events: write | ||
|
||
jobs: | ||
|
||
codeql: | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
#!/usr/bin/env node | ||
|
||
import getFolderSize from '../index.js'; | ||
import gar from 'gar'; | ||
import path from 'path'; | ||
import getFolderSize from "../index.js"; | ||
import gar from "gar"; | ||
import path from "path"; | ||
|
||
const argv = gar(process.argv.slice(2)); | ||
|
||
// --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); | ||
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; | ||
|
||
const size = await getFolderSize.strict(path.resolve(folder), {ignore}); | ||
console.log((size / 1000 / 1000).toFixed(2) + ' MB'); | ||
const size = await getFolderSize.strict(path.resolve(folder), { ignore }); | ||
console.log((size / 1000 / 1000).toFixed(2) + " MB"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
|
||
import path from 'path'; | ||
import getFolderSize from './index.js'; | ||
import path from "path"; | ||
import getFolderSize from "./index.js"; | ||
|
||
if (!process.env.FOLDER) { | ||
throw new Error('FOLDER env var needed'); | ||
throw new Error("FOLDER env var needed"); | ||
} | ||
|
||
getFolderSize.strict(path.resolve(process.env.FOLDER)).then(size => { | ||
|
||
console.log(size + ' bytes'); | ||
console.log((size / 1000 / 1000).toFixed(2) + ' MB'); | ||
|
||
getFolderSize.strict(path.resolve(process.env.FOLDER)).then((size) => { | ||
console.log(size + " bytes"); | ||
console.log((size / 1000 / 1000).toFixed(2) + " MB"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.