FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
node/tools/getnodeversion.py at main · nodejs/node · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
nodejs
/
node
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
36.6k
Star
120k
Code
Issues
632
Pull requests
750
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
node
/
tools
/
getnodeversion.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
21 lines (17 loc) · 676 Bytes
Breadcrumbs
node
/
tools
/
getnodeversion.py
Copy path
File metadata and controls
21 lines (17 loc) · 676 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
from
__future__
import
print_function
import
os
def
get_major_minor_patch
(
text
):
for
line
in
text
.
splitlines
():
if
line
.
startswith
(
'#define NODE_MAJOR_VERSION'
):
major
=
line
.
split
()[
2
]
elif
line
.
startswith
(
'#define NODE_MINOR_VERSION'
):
minor
=
line
.
split
()[
2
]
elif
line
.
startswith
(
'#define NODE_PATCH_VERSION'
):
patch
=
line
.
split
()[
2
]
return
major
,
minor
,
patch
node_version_h
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
,
'src'
,
'node_version.h'
)
with
open
(
node_version_h
)
as
in_file
:
print
(
'.'
.
join
(
get_major_minor_patch
(
in_file
.
read
())))
Back
|
FazBrowse Home
|
New Git URL