8000 (bug) (types) Workaround for `mas account` failing on macOS >= 12 by lucymhdavies · Pull Request #43 · borksh/bork · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

(bug) (types) Workaround for mas account failing on macOS >= 12 #43

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

Merged
merged 6 commits into from
Mar 25, 2022

Conversation

lucymhdavies
Copy link
Contributor

Closes #42

@github-actions github-actions bot added core Relates to core Bork code, not types or assertions types Relates to types and assertions, i.e. not the core Bork code labels Mar 25, 2022
@skylarmacdonald skylarmacdonald added the bug Something isn't working label Mar 25, 2022
@skylarmacdonald skylarmacdonald changed the title Workaround for mas account failing on macOS >= 12 (bug) (types) Workaround for mas account failing on macOS >= 12 Mar 25, 2022
@skylarmacdonald skylarmacdonald added this to the v0.14.x milestone Mar 25, 2022
@skylarmacdonald
Copy link
Member

Hmm, not sure why Danger is failing… but I think you probably know what she would have asked for 😉
Screenshot 2022-03-25 at 16 09 41

@skylarmacdonald skylarmacdonald self-requested a review March 25, 2022 16:13
@lucymhdavies
Copy link
Contributor Author

That is a good point 😂

I'll add something in here:
https://github.com/borksh/bork/blob/main/test/type-mas.bats#L6-L11

Looks like a simple thing to add

@lucymhdavies
Copy link
Contributor Author

Huh.

Well okay then 😂

not ok 218 mas status: returns FAILED_PRECONDITION when logged out
# (in test file test/type-mas.bats, line 22)
#   `[ "$status" -eq $STATUS_FAILED_PRECONDITION ]' failed
ok 219 mas status: does not return FAILED_PRECONDITION when mas account fails on macOS >= 12

@skylarmacdonald
Copy link
Member

I think you will probably need to mock uname -r to fail in the test that is supposed to throw $STATUS_FAILED_PRECONDITION to get that one to pass.

@lucymhdavies
Copy link
Contributor Author
lucymhdavies commented Mar 25, 2022

Huh.

not ok 218 mas status: returns FAILED_PRECONDITION when logged out
# (in test file test/type-mas.bats, line 23)
#   `[ "$status" -eq $STATUS_FAILED_PRECONDITION ]' failed
ok 219 mas status: does not return FAILED_PRECONDITION when mas account fails on macOS >= 12

Okay now I don't know why it's failing... or not failing when it's supposed to fail

@skylarmacdonald
Copy link
Member
skylarmacdonald commented Mar 25, 2022

I think it is to do with your less than/greater than code — I don't think Bash is clever enough to do it like that when it isn't a pure integer.

Maybe try this instead of your current line 20 in types/mas.sh:

if [ "$?" -gt 0 ]; then
  release=$(get_baking_platform_release)
  str_matches "$release" "^21\." || return $STATUS_FAILED_PRECONDITION
fi

@lucymhdavies
Copy link
Contributor Author

Yeah, that could be it.

I was doing the following to check

$ [[ "21.3" < "21." ]] && echo TRUE || echo FALSE
FALSE

$ [[ "20.0" < "21." ]] && echo TRUE || echo FALSE
TRUE

@lucymhdavies
Copy link
Contributor Author

Woo!

@skylarmacdonald skylarmacdonald merged commit 314d7c2 into borksh:main Mar 25, 2022
@skylarmacdonald
Copy link
Member

That'll do nicely! Thanks very much.

lucymhdavies added a commit to lucymhdavies/bork that referenced this pull request Jan 24, 2023
…w also include macOS 13

Addition to borksh#43

Very obviously super hacky... but it's a quick and dirty GOOD ENOUGH for now...
lucymhdavies added a commit to lucymhdavies/bork that referenced this pull request Jan 24, 2023
…w also include macOS 13

Addition to borksh#43

Very obviously super hacky... but it's a quick and dirty GOOD ENOUGH for now...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core Relates to core Bork code, not types or assertions types Relates to types and assertions, i.e. not the core Bork code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(bug) (types) Skip mas account for the short term
2 participants
0