Closed aheckler closed 6 years ago
What is the content of your Brewfile?
My Brewfile:
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-drivers"
tap "homebrew/cask-fonts"
tap "homebrew/cask-versions"
tap "homebrew/completions"
tap "homebrew/core"
tap "homebrew/dupes"
tap "homebrew/php"
tap "homebrew/services"
tap "homebrew/versions"
brew "apr"
brew "apr-util"
brew "autoconf"
brew "automake"
brew "sqlite"
brew "awscli"
brew "bash"
brew "bash-completion"
brew "brew-cask-completion"
brew "caddy"
brew "cloc"
brew "composer"
brew "coreutils"
brew "curl"
brew "diff-so-fancy"
brew "diffutils"
brew "doctl"
brew "pcre"
brew "editorconfig"
brew "exiftool"
brew "fdupes"
brew "fossil"
brew "libpng"
brew "gettext"
brew "git"
brew "git-lfs"
brew "grep", args: ["with-default-names"]
brew "htop"
brew "httpd"
brew "httpie"
brew "hub"
brew "icu4c"
brew "oniguruma"
brew "jq"
brew "jrnl"
brew "less"
brew "libxml2"
brew "m-cli"
brew "mariadb"
brew "mas"
brew "micro"
brew "n"
brew "ncurses"
brew "nano"
brew "neofetch"
brew "nginx"
brew "pandoc"
brew "php"
brew "pkg-config"
brew "pwgen"
brew "rsync"
brew "screen"
brew "subversion"
brew "tig"
brew "tldr"
brew "tree"
brew "watchman"
brew "wget"
brew "whois"
brew "wp-cli"
brew "yarn", args: ["without-node"]
brew "youtube-dl"
cask "1password-cli"
cask "alfred"
cask "arq"
cask "atom"
cask "backblaze"
cask "bartender"
cask "cleanmymac"
cask "dash"
cask "docker"
cask "dropbox"
cask "droplr"
cask "fantastical"
cask "firefox"
cask "flux"
cask "font-courier-prime"
cask "font-courier-prime-code"
cask "font-courier-prime-medium-and-semi-bold"
cask "font-courier-prime-sans"
cask "font-ibm-plex"
cask "font-input"
cask "font-noto-mono"
cask "font-noto-sans"
cask "font-noto-serif"
cask "font-roboto-mono"
cask "font-source-code-pro"
cask "font-source-sans-pro"
cask "github-desktop"
cask "google-chrome"
cask "gpgtools"
cask "hazel"
cask "imageoptim"
cask "iterm2"
cask "logitech-myharmony"
cask "logitech-options"
cask "malwarebytes"
cask "mamp"
cask "notion"
cask "sequel-pro"
cask "slack"
cask "steam"
cask "sublime-text"
cask "textexpander"
cask "transmit"
cask "twitch"
cask "virtualbox"
cask "vlc"
cask "wordpresscom"
cask "zoomus"
mas "1Password 7", id: 1333542190
mas "Amphetamine", id: 937984704
mas "BetterSnapTool", id: 417375580
mas "Day One", id: 1055511498
mas "iMovie", id: 408981434
mas "Name Mangler 3", id: 603637384
mas "Pixelmator", id: 407963104
mas "Spark", id: 1176895641
mas "Telegram Desktop", id: 946399090
mas "Textual", id: 896450579
mas "The Unarchiver", id: 425424353
mas "Things3", id: 904280696
mas "Trello", id: 1278508951
mas "Tweetbot", id: 1384080005
Pastebin It!
is missing from your Brewfile, thus it won't show in the bundle list output. Add it with:
mas "Pastebin It!", id: 944924917
And try the brew bundle list
command again.
Sorry, I think I showed the wrong command in my original post, which led to some confusion. The problem lies with brew bundle dump --file=-
which does not show that I have Pastebin It! installed:
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-drivers"
tap "homebrew/cask-fonts"
tap "homebrew/cask-versions"
tap "homebrew/completions"
tap "homebrew/core"
tap "homebrew/dupes"
tap "homebrew/php"
tap "homebrew/services"
tap "homebrew/versions"
brew "apr"
brew "apr-util"
brew "autoconf"
brew "automake"
brew "sqlite"
brew "awscli"
brew "bash"
brew "bash-completion"
brew "brew-cask-completion"
brew "caddy"
brew "cloc"
brew "composer"
brew "coreutils"
brew "curl"
brew "diff-so-fancy"
brew "diffutils"
brew "doctl"
brew "pcre"
brew "editorconfig"
brew "exiftool"
brew "fdupes"
brew "fossil"
brew "libpng"
brew "gettext"
brew "git"
brew "git-lfs"
brew "grep", args: ["with-default-names"]
brew "htop"
brew "httpd"
brew "httpie"
brew "hub"
brew "icu4c"
brew "oniguruma"
brew "jq"
brew "jrnl"
brew "less"
brew "libxml2"
brew "m-cli"
brew "mariadb"
brew "mas"
brew "micro"
brew "n"
brew "ncurses"
brew "nano"
brew "neofetch"
brew "nginx"
brew "pandoc"
brew "php"
brew "pkg-config"
brew "pwgen"
brew "rsync"
brew "screen"
brew "subversion"
brew "tig"
brew "tldr"
brew "tree"
brew "watchman"
brew "wget"
brew "whois"
brew "wp-cli"
brew "yarn", args: ["without-node"]
brew "youtube-dl"
cask "1password-cli"
cask "alfred"
cask "arq"
cask "atom"
cask "backblaze"
cask "bartender"
cask "cleanmymac"
cask "dash"
cask "docker"
cask "dropbox"
cask "droplr"
cask "fantastical"
cask "firefox"
cask "flux"
cask "font-courier-prime"
cask "font-courier-prime-code"
cask "font-courier-prime-medium-and-semi-bold"
cask "font-courier-prime-sans"
cask "font-ibm-plex"
cask "font-input"
cask "font-noto-mono"
cask "font-noto-sans"
cask "font-noto-serif"
cask "font-roboto-mono"
cask "font-source-code-pro"
cask "font-source-sans-pro"
cask "github-desktop"
cask "google-chrome"
cask "gpgtools"
cask "hazel"
cask "imageoptim"
cask "iterm2"
cask "logitech-myharmony"
cask "logitech-options"
cask "malwarebytes"
cask "mamp"
cask "notion"
cask "sequel-pro"
cask "slack"
cask "steam"
cask "sublime-text"
cask "textexpander"
cask "transmit"
cask "twitch"
cask "virtualbox"
cask "vlc"
cask "wordpresscom"
cask "zoomus"
mas "1Password 7", id: 1333542190
mas "Amphetamine", id: 937984704
mas "BetterSnapTool", id: 417375580
mas "Day One", id: 1055511498
mas "iMovie", id: 408981434
mas "Name Mangler 3", id: 603637384
mas "Pixelmator", id: 407963104
mas "Spark", id: 1176895641
mas "Telegram Desktop", id: 946399090
mas "Textual", id: 896450579
mas "The Unarchiver", id: 425424353
mas "Things3", id: 904280696
mas "Trello", id: 1278508951
mas "Tweetbot", id: 1384080005
mas
does show that I have the app installed:
Pro: ~ $ mas list
1333542190 1Password 7 (7.0.7)
1278508951 Trello (2.10.7)
425424353 The Unarchiver (4.0.0)
408981434 iMovie (10.1.9)
1055511498 Day One (2.7.4)
904280696 Things3 (3.6.1)
946399090 Telegram Desktop (1.3.10)
1384080005 Tweetbot (3.1)
407963104 Pixelmator (3.7.3)
896450579 Textual (6.0.12)
1176895641 Spark (2.0.9)
937984704 Amphetamine (3.0.2)
603637384 Name Mangler 3 (3.4.1)
417375580 BetterSnapTool (1.8)
944924917 Pastebin It! (1.0)
So I would think the issue must be in how brew bundle dump
integrates with mas
to form the list of all installed Mac App Store apps.
Even if I add mas "Pastebin It!", id: 944924917
to my Brewfile, brew bundle dump --file=-
still does not show that it's installed.
Does that clarify the situation?
OK, I think the bug is that the mas list
output for Pastebin It!, which is this:
944924917 Pastebin It! (1.0)
... is not matched by this regex:
Compare this:
http://rubular.com/r/IsVLa9PPDu
.... to this:
http://rubular.com/r/v9vyE8aYEP
cc @jacobbednarz on that ^^
Neat. Looks like that regex should be \A(?<id>\d+)\s+(?<name>[\w\s!]*)\s+\((?<version>[\d\.]*)\)\Z
instead, so that it at least can include the exclamation point.
I wonder if there are other valid names which are not matched. Maybe that middle group should have \S
instead of !
to encompass all possible non-word characters? \A(?<id>\d+)\s+(?<name>[\w\s\S]*)\s+\((?<version>[\d\.]*)\)\Z
might be the better solution in that case.
Nice detective work folks! Yes, it looks like you're correct about the exclamation mark. I did some poking around when I introduced that named capture and couldn't find any solid examples of app naming conventions from Apple so this was on a what-I-had-on-hand basis and clearly I didn't have any exclamation pointed named apps π Do either of you folks have access to what Apple restrictions are enforced for naming?
Regarding the proposed fix with \S
- I'm a little dubious on using it in combination with \s
since the regex will essentially be any whitespace character and any non-whitespace character which if I recall, is quite a large character set with some potential unknowns that may introduce regressions. If we decide to have \S
and \s
in there, we may as well use .*
as that has the same amount of coverage with less confusion. I prefer to be as explicit as possible with regexes since they can easily become unreadable and it's even easier to do when you introduce multiple metadata characters.
I'm happy to review and provide feedback on a pull request with the proposal if either of you are comfortable submitting one. If not, I can take a look into this for you at a later date.
From here:
https://developer.apple.com/app-store/review/guidelines/#accurate-metadata
2.3.7 Choose a unique app name, assign keywords that accurately describe your app, and donβt try to pack any of your metadata with trademarked terms, popular app names, or other irrelevant phrases just to game the system. App names must be limited to 30 characters and should not include prices, terms, or descriptions that are not the name of the app. App subtitles are a great way to provide additional context for your app; they must follow our standard metadata rules and should not include inappropriate content, reference other apps, or make unverifiable product claims. Apple may modify inappropriate keywords at any time or take other appropriate steps to prevent abuse.
So it seems like the only limit is that it must be under 30 characters. This guideline might also be relevant:
https://developer.apple.com/app-store/review/guidelines/#apple-sites-and-services
4.5.6 Apps may use Unicode characters that render as Apple emojis in their app and app metadata. Apple emojis may not be used on other platforms or embedded directly in your app binary.
Maybe [.*]
is best then?
Maybe [.*] is best then?
Possibly. The following change should suffice.
- app_details = app.match(/\A(?<id>\d+)\s+(?<name>[\w\s]*)\s+\((?<version>[\d\.]*)\)\Z/)
+ app_details = app.match(/\A(?<id>\d+)\s+(?<name>.*)\s+\((?<version>[\d\.]*)\)\Z/)
We'll can add a bunch of test cases for app store names with various characters to ensure it will cover what we expect.
Maybe [.*] is best then?
That will also match spaces so I'd suggest something like [^\s]
Actually, no, looking at the original one that should work π. Could one of you submit a PR?
If either @aheckler or @colindean don't show interest in the next day or so, I'll throw up the PR :) (happy to pair on it if you'd like to get some help on landing it yourself but not sure on how to do it)
From: Mike McQuaid notifications@github.com Sent: Thursday, August 23, 2018 5:38:40 PM To: Homebrew/homebrew-bundle Cc: Jacob Bednarz; Mention Subject: Re: [Homebrew/homebrew-bundle] Pastebin app not in output of "brew bundle" (#359)
Actually, no, looking at the original one that should work π. Could one of you submit a PR?
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Homebrew/homebrew-bundle/issues/359#issuecomment-415321697, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AARSYvbx2Sj7k0e5qEcFmSOmZHlt3PeNks5uTlwAgaJpZM4WHVYR.
the original one
There's been quite a few put forth. Can you specify which you mean, @mikemcquaid?
- app_details = app.match(/\A(?
\d+)\s+(? .)\s+((? [\d.] ))\Z/)
This looks good
@colindean @jacobbednarz @aheckler One of you want to give this a go?
Sure, I'll take a look in the morning and send a PR.
From: Mike McQuaid notifications@github.com Sent: Monday, August 27, 2018 6:36:53 PM To: Homebrew/homebrew-bundle Cc: Jacob Bednarz; Mention Subject: Re: [Homebrew/homebrew-bundle] Pastebin app not in output of "brew bundle" (#359)
@colindeanhttps://github.com/colindean @jacobbednarzhttps://github.com/jacobbednarz @ahecklerhttps://github.com/aheckler One of you want to give this a go?
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Homebrew/homebrew-bundle/issues/359#issuecomment-416156381, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AARSYurrlEp8kJrOfcNVaUSXx1pKu6Z9ks5uU6-lgaJpZM4WHVYR.
Here's the output of
mas list
on my machine:Compare to the output of
brew bundle list --mas --global
:They're different in that the "Pastebin It!" app isn't included in the output of
brew bundle
even though it's installed.brew bundle
must be getting hung up somehow, perhaps due to the exclamation mark?