FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
docarray/scripts/prepend_version_json.py at fix-num-docs · docarray/docarray · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
docarray
/
docarray
Public
Notifications
You must be signed in to change notification settings
Fork
243
Star
3.1k
Code
Issues
68
Pull requests
43
Discussions
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
docarray
/
scripts
/
prepend_version_json.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
21 lines (18 loc) · 557 Bytes
Breadcrumbs
docarray
/
scripts
/
prepend_version_json.py
Copy path
File metadata and controls
21 lines (18 loc) · 557 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import
argparse
import
json
from
typing
import
List
parser
=
argparse
.
ArgumentParser
(
prog
=
"Prepender docs/_versions.json"
)
parser
.
add_argument
(
"--version"
,
type
=
str
,
help
=
"The version we wish to prepend (e.g. v0.18.0)"
,
required
=
True
,
)
args
=
parser
.
parse_args
()
with
open
(
"./docs/_versions.json"
)
as
f
:
versions
:
List
[
dict
]
=
json
.
load
(
f
)
element
=
{
k
:
v
for
k
,
v
in
args
.
_get_kwargs
()}
if
element
!=
versions
[
0
]:
versions
.
insert
(
0
,
element
)
with
open
(
"./docs/_versions.json"
,
"w"
)
as
f
:
json
.
dump
(
versions
,
f
)
Back
|
FazBrowse Home
|
New Git URL