File tree Expand file tree Collapse file tree 2 files changed +19
-6
lines changed
Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -20,13 +20,14 @@ Use the `--help` flag for instructions
2020
2121```
2222$ filet --help
23- usage: filet.exe [-h] [--version] [--root [ROOT]] [--notree] struc
23+ usage: main.py [-h] [--version] [--update ] [--root [ROOT]] [--notree] struc
2424
2525optional arguments:
2626 -h, --help show this help message and exit
2727
2828INFO:
2929 --version, -v Prints out current version and release date of Filet
30+ --update, -u Makes the update checker verbose
3031
3132CREATE:
3233 --root [ROOT], -r [ROOT]
@@ -87,12 +88,17 @@ src/tests
8788
8889## Updating
8990
90- To update the version of ` filet ` on your computer:
91+ ### Manually
9192
92931 . Download the desired (preferably _ latest_ ) version of ` filet.exe ` from the [ releases] ( https://github.com/gitwikc/filet/releases ) page.
93942 . Save it in the directory where you have previously installed ` filet `
94953 . 🎆 YAY! You have successfully updated ` filet ` on your computer
9596
97+ ### From CLI
98+
99+ - Filet automatically checks for updates each time it is run and will notify you about any new updates it finds.
100+ - To make the update checking process verbose, use the ` --update ` or ` -u ` flag
101+
96102## Contributing
97103
98104Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Original file line number Diff line number Diff line change @@ -23,13 +23,20 @@ def get_releases_list():
2323 return releases
2424
2525
26- def get_available_update ():
27- latest_release = get_releases_list ()[0 ]
26+ def get_available_update (verbose : bool = False ):
27+ try :
28+ latest_release = get_releases_list ()[0 ]
29+ except Exception as ex :
30+ if verbose :
31+ print ('Something went wrong while checking for updates.' )
32+ print (f'{ Fore .YELLOW } Are you connected to the internet?' )
33+ return False
34+
2835 current_release = get_release_info ()
2936 if latest_release ['name' ] != current_release ['version' ]:
3037 return latest_release
3138 else :
32- return None
39+ return False
3340
3441
3542def download_filet (download_url : str , dest : str ):
@@ -52,7 +59,7 @@ def check_for_updates(verbose: bool = False):
5259 if verbose :
5360 spinner = Halo (text = 'Checking for updates...' , spinner = 'dots' )
5461 spinner .start ()
55- latest_update = get_available_update ()
62+ latest_update = get_available_update (verbose )
5663 if verbose :
5764 spinner .stop ()
5865
You can’t perform that action at this time.
0 commit comments