Skip to content

Commit 239969e

Browse files
committed
Use TOML standard library explicitly instead of Pkg.TOML
1 parent 893678c commit 239969e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
88
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
99
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
1010
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
11+
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
1112
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1213

1314
[compat]

src/PkgAuthentication.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Downloads
44
import JSON
55
import Pkg
66
import Random
7+
import TOML
78

89
const pkg_server_env_var_name = "JULIA_PKG_SERVER"
910

@@ -132,7 +133,7 @@ end
132133
function step(state::NeedAuthentication)::Union{HasToken, NoAuthentication}
133134
path = token_path(state.server)
134135
if isfile(path)
135-
toml = Pkg.TOML.parsefile(path)
136+
toml = TOML.parsefile(path)
136137
if is_token_valid(toml)
137138
return HasToken(state.server, mtime(path), toml)
138139
else
@@ -228,9 +229,9 @@ function step(state::HasNewToken)::Union{HasNewToken, Success, Failure}
228229
mkpath(dirname(path))
229230
try
230231
open(path, "w") do io
231-
Pkg.TOML.print(io, state.token)
232+
TOML.print(io, state.token)
232233
end
233-
if Pkg.TOML.parsefile(path) == state.token
234+
if TOML.parsefile(path) == state.token
234235
return Success(state.token)
235236
else
236237
return HasNewToken(state.server, state.token, 0)

0 commit comments

Comments
 (0)