Skip to content

Commit

Permalink
Ignore & quiet
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoDog896 committed Aug 3, 2022
1 parent e530211 commit 847c317
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# deno-outdated

```bash
deno install --allow-read=./ --allow-net --allow-write=./ -f -n=deno-outdated https://deno.land/x/deno-outdated/cli.ts

Scans & updates your project at an entry point for outdated deno dependencies.
This will not update non-pinned dependencies (dependencies without any version
specified)
Expand Down
10 changes: 7 additions & 3 deletions cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ import { findAndReplace } from "./change.ts";
await new Command()
.name("deno-outdated")
.version("0.0.1")
.option("-q --quiet <quiet:boolean>", "Silence any output", {
default: false
.option("-q --quiet", "Silence any output", {
default: false,
})
.option("-i --ignore [ignore:string[]]", "list of files to ignore", {
separator: " "
})
.description(
"Check for outdated dependencies for deno.land/x and other various 3rd party vendors",
)
.action(async ({ quiet }) => {
.action(async ({ quiet, ignore }) => {
let count = 0;
for await (const file of Deno.readDir(Deno.cwd())) {
if (!file.isFile) continue;
if (Array.isArray(ignore) && ignore.includes(file.name)) continue;

const originalSource = await Deno.readTextFile(file.name);
const newSource = await findAndReplace(originalSource);
Expand Down
1 change: 1 addition & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"tasks": {
"install": "deno install --allow-read=./ --allow-net --allow-write=./ -f -n=deno-outdated ./cli.ts",
"update": "deno run --allow-read=./ --allow-net --allow-write=./ ./cli.ts --ignore README.md",
"test": "deno test --allow-net"
}
}
5 changes: 2 additions & 3 deletions test/change.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ Deno.test("Source code translation works", async () => {

Deno.test("Comment ignore works", async () => {
const source =
`const x = 'https://deno.land/[email protected]/testing/asserts.ts'; ${
"i-deno-outdated" && ""
}
// deno-fmt-ignore
`const x = 'https://deno.land/[email protected]/testing/asserts.ts'; ${"i-deno-outdated" && ""}
const x = 'https://deno.land/[email protected]/testing/asserts.ts' // i-deno-outdated ";`;
const redirect = await findAndReplace(source);

Expand Down

0 comments on commit 847c317

Please sign in to comment.