Skip to content

Commit a373768

Browse files
authored
puller flag and cleanup (#34)
1 parent ed63331 commit a373768

File tree

6 files changed

+24
-16
lines changed

6 files changed

+24
-16
lines changed

.github/workflows/ci.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
gleam-version: ${{ env.gleam }}
3535
rebar3-version: ${{ env.rebar }}
3636
- run: gleam test --target erlang
37+
- run: gleam run --target erlang -- --puller wget
3738
- run: gleam run --target erlang -- --outdated
3839

3940
windows-erlang:
@@ -67,7 +68,8 @@ jobs:
6768
runs-on: ubuntu-latest
6869
strategy:
6970
matrix:
70-
node-version: [20.x, 22.x, 23.x]
71+
node-version: [22.x, 23.x]
72+
puller: [curl, wget]
7173
steps:
7274
- uses: actions/checkout@v4
7375
- uses: erlef/setup-beam@v1
@@ -82,7 +84,7 @@ jobs:
8284
cache: "npm"
8385
- run: npm install
8486
- run: gleam test --target javascript --runtime nodejs
85-
- run: gleam run --target javascript --runtime nodejs -- --outdated
87+
- run: gleam run --target javascript --runtime nodejs -- --outdated --puller ${{ matrix.puller }}
8688

8789
bun:
8890
runs-on: ubuntu-latest
@@ -96,6 +98,7 @@ jobs:
9698
- uses: oven-sh/setup-bun@v1
9799
- run: bun install
98100
- run: gleam test --target javascript --runtime bun
101+
- run: gleam run --target javascript --runtime bun -- --puller wget
99102
- run: gleam run --target javascript --runtime bun -- --outdated
100103

101104
deno:
@@ -112,4 +115,5 @@ jobs:
112115
deno-version: v2.x # Run with latest stable Deno.
113116
- run: deno install
114117
- run: gleam test --target javascript --runtime deno
118+
- run: gleam run --target javascript --runtime deno -- --puller wget
115119
- run: gleam run --target javascript --runtime deno -- --outdated

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ gleam run -m go_over
5252

5353
- `--format` FORMAT: Specify the output format of any warnings, [minimal,
5454
verbose, json] (default: None)
55-
- `--puller` Specify the tool used to reach out to hex.pm, [curl, wget, httpie] (default: None)
55+
- `--puller` Specify the tool used to reach out to hex.pm, [curl, wget, httpie]
56+
(default: None)
5657
- `--force`: Force pulling new data even if the cached data is still valid
5758
- `--outdated`: Additionally check if newer versions of dependencies exist
5859
- `--ignore-indirect`: Ignore all warnings for indirect dependencies

gleam.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name = "go_over"
2-
version = "3.0.0"
2+
version = "3.0.1"
33
licences = ["MIT"]
44
repository = { type = "github", user = "bwireman", repo = "go-over" }
55
description = "A tool to audit Erlang & Elixir dependencies, to make sure your Gleam ✨ projects really sparkle!"

src/go_over/config.gleam

+11-11
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import gleam/string
1111
import go_over/advisories/advisories.{type Advisory}
1212
import go_over/hex/puller
1313
import go_over/packages.{type Package}
14+
import go_over/util/constants
1415
import go_over/util/print
1516
import go_over/warning.{type Warning}
1617
import gxyz/cli
@@ -224,7 +225,13 @@ fn toml_as_string(toml: Toml) -> Option(String) {
224225
}
225226
}
226227

227-
// ? want to head the `fake` flag but otherwise use the default help
228+
const logo = " ____ ____ ____ _ _____ _____
229+
/ __ `/ __ \\ / __ \\ | / / _ \\/ ___/
230+
/ /_/ / /_/ / / /_/ / |/ / __/ /
231+
\\__, /\\____/____\\____/|___/\\___/_/
232+
/____/ /_____/"
233+
234+
// ? want to hide the `fake` flag but otherwise use the default help
228235
fn help_message(args: arg_info.ArgInfo) -> String {
229236
arg_info.ArgInfo(
230237
named: args.named,
@@ -234,15 +241,8 @@ fn help_message(args: arg_info.ArgInfo) -> String {
234241
)
235242
|> arg_info.help_text(
236243
"go_over",
237-
" ____ ____ ____ _ _____ _____
238-
/ __ `/ __ \\ / __ \\ | / / _ \\/ ___/
239-
/ /_/ / /_/ / / /_/ / |/ / __/ /
240-
\\__, /\\____/____\\____/|___/\\___/_/
241-
/____/ /_____/
242-
version 3.0.0
243-
"
244-
|> print.format_high()
245-
<> "🕵️ Audit Erlang & Elixir dependencies, to make sure your gleam projects really ✨ sparkle!",
244+
print.format_high(logo <> "\tversion: " <> constants.version <> "\n")
245+
<> "🕵️Audit Erlang & Elixir dependencies, to make sure your gleam projects really ✨ sparkle!",
246246
)
247247
// ? strip out the pointless leading go_over in the help message
248248
|> string.crop(" ")
@@ -262,7 +262,7 @@ pub fn merge_flags_and_config(flags: Flags, cfg: Config) -> Config {
262262
fake: flags.fake,
263263
verbose: flags.verbose,
264264
allowed_licenses: cfg.allowed_licenses,
265-
puller: cfg.puller,
265+
puller: option.unwrap(flags.puller, cfg.puller),
266266
global:,
267267
format: option.unwrap(flags.format, cfg.format),
268268
ignore_packages: cfg.ignore_packages,

src/go_over/util/cache.gleam

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import filepath
33
import gleam/int
44
import gleam/order
55
import gleam/result
6+
import go_over/util/constants
67
import go_over/util/print
78
import gxyz/cli
89
import simplifile
@@ -64,7 +65,7 @@ pub fn pull_if_not_cached(
6465

6566
path
6667
|> version_name()
67-
|> simplifile.write("3.0.0")
68+
|> simplifile.write(constants.version)
6869
|> cli.hard_fail_with_msg("could not write cache file for " <> path)
6970

7071
Nil

src/go_over/util/constants.gleam

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ pub const hour = 3600
77

88
pub const six_hours = 21_600
99

10+
pub const version = "3.0.1"
11+
1012
pub const advisories_repo = "mirego/elixir-security-advisories"
1113

1214
pub const long_ass_dashes = "\n-----------------------------------------------\n"

0 commit comments

Comments
 (0)