Skip to content
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

don't reinstall already installed casks #233

Closed
wants to merge 1 commit into from
Closed

don't reinstall already installed casks #233

wants to merge 1 commit into from

Conversation

ccutrer
Copy link
Contributor

@ccutrer ccutrer commented Apr 19, 2013

No description provided.

@passcod
Copy link
Contributor

passcod commented Apr 19, 2013

Given there's not upgrade command, this is actually a non-feature.

@ccutrer
Copy link
Contributor Author

ccutrer commented Apr 19, 2013

Not really. If there is a new version of the formula, installed? will return false (because it checks if the directory for the current version exists), and thus install will continue as normal.

@passcod
Copy link
Contributor

passcod commented Apr 20, 2013

True. Mmm, I don't remember how exactly installed? is defined, does it take into account "devel" formulae and installs? If it does, then alright. Otherwise, this would need more thought, as "devel" / HEAD formulae (or whatever we call them) don't have versioning and installing should really just fetch the latest version at the time it's run.

@phinze
Copy link
Contributor

phinze commented Apr 21, 2013

I am 👍 on this idea, but I think @passcod may be right that this kills an upgrade path for Casks that use the latest convention, e.g. rdio. Because the destination path never changes, the guard will always fire.

Maybe this could be acceptable if we added a --force option to push past it.

We'd also need some tests around the behavior before we could pull it in.

Lemme know if this makes sense - I think with some tests and an override option we'd be cool to pull this in.

@mathiasbynens
Copy link
Contributor

In the meantime I use this workaround:

brew tap phinze/homebrew-cask
brew install brew-cask

function installcask() {
    if brew cask info "${@}" | grep "Not installed" > /dev/null; then
        brew cask install "${@}"
    else
        echo "${@} is already installed."
    fi
}

installcask foo
installcask bar
# etc.

@passcod
Copy link
Contributor

passcod commented May 10, 2013

Maybe we could have a check to see if the cask is using 'latest' (and hardcode that to start with; more semantic/flexible checking would be available with #142): let it through in this case, and raise otherwise.

phinze pushed a commit that referenced this pull request May 12, 2013
thanks to @ccutrer for the catch; this implementation is based on his PR

refs #233
@phinze
Copy link
Contributor

phinze commented May 13, 2013

Hey this is all done in 17026b6 - install gets a --force option to override the check. Going to close this - feel free to reopen if this doesn't work for you. 🐼

@phinze phinze closed this May 13, 2013
@Homebrew Homebrew locked and limited conversation to collaborators May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants