0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-29 08:58:01 -04:00
denoland-deno/format.ts
Nayeem Rahman 2f90225c89 Implement expandGlob() and expandGlobSync() (denoland/deno_std#617)
fs/glob.ts:
- Improve prototypes for expandGlob() and expandGlobSync() from denoland/deno_std#604.
- Rename glob() to globToRegExp().
- Add normalizeGlob() and joinGlobs().
- Extract GlobToRegExpOptions from GlobOptions, remove the strict
  and filepath options.

fs/globrex.ts:
- Add GlobrexOptions.

fs/path/constants.ts:
- Add SEP_PATTERN.

fs/walk.ts:
- Add WalkOptions::includeFiles
- Default WalkOptions::includeDirs to true.
- Don't traverse directories matching a skip pattern.
- Remove walkSync()'s default root value.

prettier:
- Refactor to use expandGlob().

testing:
- Make findTestModules() an async generator.
Original: 8c90bd9d0b
2019-10-02 13:59:27 -04:00

32 lines
690 B
TypeScript
Executable file

#!/usr/bin/env -S deno run --allow-run --allow-write --allow-read --allow-env
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
const { exit, args, execPath } = Deno;
import { parse } from "./flags/mod.ts";
import { xrun } from "./prettier/util.ts";
async function main(opts): Promise<void> {
const args = [
execPath(),
"run",
"--allow-write",
"--allow-read",
"prettier/main.ts",
"--ignore",
"node_modules",
"--ignore",
"**/testdata",
"--ignore",
"**/vendor",
"--write"
];
if (opts.check) {
args.push("--check");
}
args.push(".");
exit((await xrun({ args }).status()).code);
}
main(parse(args));