Skip to content

Commit

Permalink
Actually fixed -feu bug
Browse files Browse the repository at this point in the history
  • Loading branch information
targendaz2 committed Nov 26, 2019
1 parent a94e40a commit 51ccdfc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.1.3] - 2019-11-26
### Fixed
* *Actually* fixed bug where using `-feu` would ignore valid user homes

## [1.1.2] - 2019-11-26
### Fixed
* Fixed bug where using `-feu` would ignore valid user homes
Expand Down
9 changes: 3 additions & 6 deletions payload/msda.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
__author__ = 'David G. Rosenberg'
__copyright__ = 'Copyright (c), Mac Set Default Apps'
__license__ = 'MIT'
__version__ = '1.1.2'
__version__ = '1.1.3'
__email__ = 'dgrosenberg@icloud.com'


Expand Down Expand Up @@ -120,11 +120,8 @@ def gather_user_ls_paths():
ls_paths = []
for user in gathered_users:
user_ls_path = create_user_ls_path(user)
if not os.path.exists(os.path.dirname(user_ls_path)):
continue
elif not os.path.exists(user_ls_path):
continue
ls_paths.append(user_ls_path)
if os.path.exists(os.path.dirname(user_ls_path)):
ls_paths.append(user_ls_path)

return ls_paths

Expand Down
7 changes: 4 additions & 3 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,11 +551,12 @@ def test_set_handlers_for_all_existing_valid_users(self,):
arguments.extend(['-p', handler.uti])

for user_home in fake_user_homes[:-num_invalid_users]:
user_ls_path = self.seed_plist(
SIMPLE_BINARY_PLIST,
os.path.join(user_home, msda.PLIST_RELATIVE_LOCATION),
user_ls_path = os.path.join(
user_home,
msda.PLIST_RELATIVE_LOCATION,
msda.PLIST_NAME,
)
os.makedirs(os.path.dirname(user_ls_path))
user_ls = msda.LaunchServices(user_ls_path)
for handler in handlers:
self.assertNotIn(handler, user_ls.handlers)
Expand Down

0 comments on commit 51ccdfc

Please sign in to comment.