Skip to content

Commit

Permalink
update exe
Browse files Browse the repository at this point in the history
  • Loading branch information
Matanga1-2 committed Jan 31, 2025
1 parent 00efc7a commit 1d582e0
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion build_exe.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ def main():
if src_path not in sys.path:
sys.path.insert(0, src_path)
# Create Yad2Scraper directory in user's home if it doesn't exist
home_dir = os.path.expanduser('~')
app_dir = os.path.join(home_dir, '.Yad2Scraper')
credentials_dir = os.path.join(app_dir, 'credentials')
os.makedirs(credentials_dir, exist_ok=True)
# Copy client_secret.json to credentials directory if it exists in the package
client_secret_src = os.path.join(base_path, 'src', 'mail_sender', 'client_secret.json')
client_secret_dst = os.path.join(credentials_dir, 'client_secret.json')
if os.path.exists(client_secret_src) and not os.path.exists(client_secret_dst):
import shutil
shutil.copy2(client_secret_src, client_secret_dst)
# Now import and run the actual main function
from src.main import main
sys.exit(main())
Expand Down Expand Up @@ -74,7 +87,7 @@ def main():

# Include all data files
'--add-data=consts/*:consts',
'--add-data=src/mail_sender/client_secret.json:src/mail_sender',
'--add-data=src/mail_sender/client_secret.json:src/mail_sender', # Still include it in the package
'--add-data=.env:.',
'--add-data=src:src', # Add the entire src directory

Expand Down

0 comments on commit 1d582e0

Please sign in to comment.