-
Notifications
You must be signed in to change notification settings - Fork 524
installinstallmacos.py: Fix bad_dir check, and make warning louder #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
072b65b
217e987
aeaa732
55779df
90dd3b9
4f32302
9990295
ea4ae17
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -531,15 +531,17 @@ def main(): | |
| sys.exit('This command requires root (to install packages), so please ' | ||
| 'run again with sudo or as root.') | ||
|
|
||
| home_dir = os.path.expanduser("~") | ||
| current_dir = os.getcwd() | ||
| if os.path.expanduser("~") in current_dir: | ||
| bad_dirs = ['Documents', 'Desktop', 'Downloads', 'Library'] | ||
| for bad_dir in bad_dirs: | ||
| if bad_dir in os.path.split(current_dir): | ||
| print('Running this script from %s may not work as expected. ' | ||
| 'If this does not run as expected, please run again from ' | ||
| 'somewhere else, such as /Users/Shared.' | ||
| % current_dir, file=sys.stderr) | ||
| bad_subdirs = ['Documents', 'Desktop', 'Downloads', 'Library'] | ||
| for bad_subdir in bad_subdirs: | ||
| bad_dir = home_dir + os.path.sep + bad_subdir | ||
| if bad_dir in current_dir: | ||
| print('*********************************************************', file=sys.stderr) | ||
| print('*** Running this script from %s may not work as expected.' % current_dir, file=sys.stderr) | ||
| print('*** If this does not run as expected, please run again from', file=sys.stderr) | ||
| print('*** somewhere else, such as /Users/Shared.', file=sys.stderr) | ||
| print('*********************************************************', file=sys.stderr) | ||
|
||
|
|
||
| if args.catalogurl: | ||
| su_catalog_url = args.catalogurl | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really should be using os.path.join()