Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F112650
otp_version.ex
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
851 B
Referenced Files
None
Subscribers
None
otp_version.ex
View Options
# Pleroma: A lightweight social networking server
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule
Pleroma.OTPVersion
do
@spec
version
()
::
String
.
t
()
|
nil
def
version
do
# OTP Version https://erlang.org/doc/system_principles/versions.html#otp-version
[
Path
.
join
(
:code
.
root_dir
(),
"OTP_VERSION"
),
Path
.
join
([
:code
.
root_dir
(),
"releases"
,
:erlang
.
system_info
(
:otp_release
),
"OTP_VERSION"
])
]
|>
get_version_from_files
()
end
@spec
get_version_from_files
([
Path
.
t
()])
::
String
.
t
()
|
nil
def
get_version_from_files
([]),
do
:
nil
def
get_version_from_files
([
path
|
paths
])
do
if
File
.
exists?
(
path
)
do
path
|>
File
.
read!
()
|>
String
.
replace
(
~r/
\r
|
\n
|
\s
/
,
""
)
else
get_version_from_files
(
paths
)
end
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Sat, Nov 23, 9:37 PM (1 d, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38573
Default Alt Text
otp_version.ex (851 B)
Attached To
Mode
rPUBE pleroma-upstream
Attached
Detach File
Event Timeline
Log In to Comment