Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(jans-cli-tui): move agama archiever to jans-cli directory #5721

Merged
merged 4 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions jans-linux-setup/tools/gamarchive.py → jans-cli-tui/cli_tui/gama-archieve-cli.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import os
import sys
import json
Expand All @@ -12,7 +14,7 @@
parser.add_argument('-exclude-extension', help="Exclude files having this extension", action='append')
parser.add_argument('-exclude-file', help="Exclude files having this name", action='append')
parser.add_argument('-exclude-dir', help="Exclude files in this directory", action='append')
parser.add_argument('-agama-archive-name', help="Output file name of project archive. If excluded archive name will be created based on directory")
parser.add_argument('-agama-archieve-name', help="Output file name of project archieve. If excluded archieve name will be created based on directory")
argsp = parser.parse_args()


Expand All @@ -39,17 +41,12 @@
exclude_files[i] = os.path.join(argsp.directory, efn)



#print("exclude_extensions:", exclude_extensions)
#print("exclude_dirs:", exclude_dirs)
#print("exclude_files:", exclude_files)

if not agama_path.is_dir():
print("{} is not a directory".format(agama_path))
sys.exit()

if argsp.agama_archive_name:
agama_zip_fn = argsp.agama_archive_name
if argsp.agama_archieve_name:
agama_zip_fn = argsp.agama_archieve_name
else:
agama_zip_fn = agama_path.name

Expand Down Expand Up @@ -81,9 +78,8 @@
flows = []

for fpath, rpath in file_list:
if fpath.is_file():
if rpath.suffix == '.flow' and rpath.parts[0] == 'code':
flow_files.append((fpath, rpath))
if fpath.is_file() and rpath.suffix == '.flow' and rpath.parts[0] == 'code':
flow_files.append((fpath, rpath))

for mdir in mandatory_dirs:
if not mandatory_dirs[mdir]:
Expand All @@ -99,8 +95,8 @@ def strip_quotation(s):
if s:
if s[0] == '"':
return s.strip('"')
elif s[0] == '"':
return s.strip('"')
elif s[0] == "'":
return s.strip("'")

return s

Expand Down Expand Up @@ -201,7 +197,7 @@ def get_path(path_s, l):
with open(sha256sum_fn, 'w') as w:
w.write(sha256hash)

print("All seems good. Archive {} and signature file {} were created".format(agama_zip_fn, sha256sum_fn))
print("All seems good. Archieve {} and signature file {} were created".format(agama_zip_fn, sha256sum_fn))



Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ def install(self):

self.run([paths.cmd_ln, '-s', os.path.join(self.jans_cli_install_dir, 'cli', 'config_cli.py'), os.path.join(self.jans_cli_install_dir, 'config-cli.py')])
self.run([paths.cmd_ln, '-s', os.path.join(self.jans_cli_install_dir, 'jans_cli_tui.py'), os.path.join(self.jans_cli_install_dir, 'config-cli-tui.py')])
#self.run([paths.cmd_ln, '-s', os.path.join(self.jans_cli_install_dir, 'config_cli.py'), os.path.join(self.jans_cli_install_dir, 'scim-cli.py')])
self.run([paths.cmd_chmod, '+x', os.path.join(self.jans_cli_install_dir, 'cli', 'config_cli.py')])
self.run([paths.cmd_chmod, '+x', os.path.join(self.jans_cli_install_dir, 'jans_cli_tui.py')])

gama_archiever_fn = 'gama-archieve-cli.py'
self.run([paths.cmd_chmod, '+x', os.path.join(self.jans_cli_install_dir, gama_archiever_fn)])
self.run([paths.cmd_ln, '-s', os.path.join(self.jans_cli_install_dir, gama_archiever_fn), os.path.join(Config.jansOptBinFolder, gama_archiever_fn)])

#extract python libraries
base.extract_from_zip(self.source_files[0][0], 'jwt', os.path.join(self.pylib_dir, 'jwt'))
Expand Down