Skip to content

Commit

Permalink
fix(jans-linux-setup): backup cli direcory if any (#976)
Browse files Browse the repository at this point in the history
  • Loading branch information
devrimyatar committed Mar 4, 2022
1 parent b5691b5 commit dc42d0f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jans-linux-setup/jans_setup/setup_app/installers/jans_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import re
import configparser
import tarfile
import shutil
import shutil
import time

from setup_app import paths
from setup_app.utils import base
Expand Down Expand Up @@ -47,6 +48,10 @@ def install(self):

self.logIt("Installing Jans Cli", pbar=self.service_name)

# backup if exists
if os.path.exists(self.jans_cli_install_dir):
self.run(['mv', '-f', self.jans_cli_install_dir, self.jans_cli_install_dir+'_backup-{}'.format(time.ctime())])

#extract jans-cli tgz archieve
base.extract_from_zip(self.source_files[0][0], 'jans-cli/cli', self.jans_cli_install_dir)

Expand Down

0 comments on commit dc42d0f

Please sign in to comment.