Skip to content

Commit

Permalink
Merge pull request #60 from QAInsights/fix/mac-app-default-config-on-…
Browse files Browse the repository at this point in the history
…relaunch

Copy properties file only if not exist and once
  • Loading branch information
QAInsights authored Nov 28, 2023
2 parents 32d656b + bdf61eb commit e89b49b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hamster/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
source_path = os.path.join(os.path.dirname(sys.argv[0]), app_properties_template)

# Define the destination path (user's home directory)
destination_path = os.path.join(home_dir, app_properties_template)
properties_file_path = os.path.join(home_dir, app_properties_template)

# Use shutil to copy the file
shutil.copy(source_path, destination_path)
# Use shutil to copy the file if file doesn't exist
if not os.path.exists(properties_file_path):
shutil.copy(source_path, properties_file_path)

config_parser = configparser.ConfigParser()
properties_file_path = os.path.join(home_dir, app_properties_template)
config_parser.read(properties_file_path)

icon_path = os.path.join(os.path.dirname(sys.argv[0]), 'img/hamster.png')
Expand Down

0 comments on commit e89b49b

Please sign in to comment.