mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 22:06:05 +01:00
output version
This commit is contained in:
@@ -54,15 +54,4 @@ class cliParser:
|
|||||||
parser.add_argument('--userName', help='Email Username.')
|
parser.add_argument('--userName', help='Email Username.')
|
||||||
parser.add_argument('--password', help='Email password.')
|
parser.add_argument('--password', help='Email password.')
|
||||||
|
|
||||||
## Get CurrentVersion
|
|
||||||
with open('/usr/local/CyberCP/version.txt') as file:
|
|
||||||
file_contents = file.read()
|
|
||||||
version = re.search('\d.\d', file_contents)
|
|
||||||
version = version.group()
|
|
||||||
build = file_contents[-2:]
|
|
||||||
build = build[0:1]
|
|
||||||
currentversion = version + '.' + build
|
|
||||||
parser.add_argument('--version', action='version', version=currentversion)
|
|
||||||
parser.parse_args(['--version'])
|
|
||||||
|
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
@@ -1312,6 +1312,16 @@ def main():
|
|||||||
|
|
||||||
command = '/usr/bin/cyberpanel_utility --help'
|
command = '/usr/bin/cyberpanel_utility --help'
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
elif args.function == 'version' or args.function == 'v' or args.function == 'V':
|
||||||
|
## Get CurrentVersion
|
||||||
|
with open('/usr/local/CyberCP/version.txt') as file:
|
||||||
|
file_contents = file.read()
|
||||||
|
version = re.search('\d.\d', file_contents)
|
||||||
|
version = version.group()
|
||||||
|
build = file_contents[-2:]
|
||||||
|
build = build[0:1]
|
||||||
|
currentversion = version + '.' + build
|
||||||
|
print (currentversion)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user