Commit graph

205 commits

Author SHA1 Message Date
Roland Walker
81744a038d bugfix: make uninstall :script accept a hash
The indentation in CONTRIBUTING.md implies that :script accepts a hash.
But that is not the case. Instead :script accesses the entire hash defined
by uninstall.  Unrelated install keys such as :quit leak through to
@command.run! when attempting to exec :script.  Result: contrary to docs,
:script cannot be combined with other uninstall keys.

This PR makes uninstall :script accept a hash.  When :args or :input are not
needed, :script can still accept a plain string, so many Casks require no
alteration.

In addition
- adds key :executable, required when using hash argument to :script
- keys to :script are validated and sanitized before being passed to
  @command.run!
- adds :quit to with-installable.rb test to protect against regression
  on leaky keys
2014-01-11 12:20:59 -05:00
Fernando Paredes
3093e5a111 Merge pull request #2370 from troter/coteditor
Coteditor
2014-01-10 13:14:31 -08:00
Paul Hinze
6786f336e8 Merge pull request #2303 from rolandwalker/qualified_cask_names
handle fully-qualified cask names, fixes #2235
2014-01-10 11:23:43 -08:00
Paul Hinze
fead909887 Merge pull request #2263 from rolandwalker/faster_uninstall
uninstall files in chunks of 500.
2014-01-10 11:09:06 -08:00
Paul Hinze
9135ff5730 Merge pull request #2258 from rolandwalker/hardlink_fonts
use hard links for fonts instead of symlinks
2014-01-10 11:06:17 -08:00
Paul Hinze
2412bfebbb Merge pull request #2360 from jfb/master
chown can only be run as root
2014-01-10 11:02:56 -08:00
Paul Hinze
b850d78427 Merge pull request #2240 from linc01n/audit
Check no_checksum if version is latest in audit
2014-01-10 10:59:36 -08:00
Paul Hinze
9bd923fafa Merge pull request #2152 from Dillon-Benson/patch-2
shows that there are no casks matching a search term that did not result...
2014-01-10 10:58:45 -08:00
Paul Hinze
0967e4dd51 try forcing a require of homebrew's download_strategy
working on fixing #2275
2014-01-10 10:42:18 -06:00
Takumi IINO
4670d25369 Allow download url of sourceforge.jp 2014-01-10 14:59:25 +09:00
James Felix Black
83d5e7dfe4 chown can only be run as root
The logic here was flawed -- my caskroom.parent was writeable, but chown
was called regardless, causing an error.
2014-01-08 11:22:32 -08:00
Paul Hinze
ec85054cb2 Merge pull request #2342 from rolandwalker/doctor_command
add command "brew cask doctor"
2014-01-08 09:44:09 -08:00
Roland Walker
f2b3401310 Merge pull request #2345 from miguelfrde/2344-qlmanage
Run 'qlmanage -r' after installing a QuickLook plugin
2014-01-07 19:06:09 -08:00
Miguel Flores Ruiz de Eguino
877f96ad91 Run 'qlmanage -r' after installing a QuickLook plugin 2014-01-07 01:02:03 -06:00
Roland Walker
d120d3b1a8 add command "brew cask doctor"
pursuant to discussion in #2275
2014-01-06 11:50:17 -05:00
Stratos Moros
7136269198 implement binary artifact 2014-01-05 22:55:18 +02:00
Roland Walker
4123b05efa use hard links for fonts instead of symlinks
per an issue reported by @jgarber623.  Recast for compatibility
with #2300.
2014-01-04 12:39:37 -05:00
Paul Hinze
a369f7ffd4 Merge pull request #2304 from rolandwalker/uri_feedback
add feedback when downloading a URI source
2014-01-04 07:50:44 -08:00
Roland Walker
f223821038 add feedback when downloading a URI source
otherwise the user sees the curl progress bar w/o explanation
2014-01-04 07:43:29 -05:00
Roland Walker
b88bf787e0 handle fully-qualified cask names, fixes #2235
form "<user>/<repo>/<cask>" may be used on cmdline, matching homebrew
- refactor Cask::Source::Tap into Cask::Source::Tapped, removing
  code, only handling unqualified cask names here now (ie no slash)
- create Cask::Source::TappedQualified, handling "<user>-<repo>/<cask>"
  form as before, and new form "<user>/<repo>/<cask>", for the case that
  the relevant tap already exists
- create Cask::Source::UntappedQualified, handling both command-line
  forms as above, but implicitly creating adding a new tap if it
  does not already exist
- add module Cask::QualifiedCaskName for utility functions on qualified
  Cask names
2014-01-04 07:14:35 -05:00
Roland Walker
a4149be6ef refactor artifacts
- abstracts out common logic, much code removed
- fixes one bug/inconsistency: some artifacts failed to
  "return false" when the target exists in "preflight_checks".
- one trivial functional change: artifact type and quotation marks
  added in all user feedback (quotes needed b/c of pathnames
  containing spaces)
2014-01-03 17:08:09 -05:00
Roland Walker
cfee08ab9e uninstall files in chunks of 500.
This is intended to address #2122.
2013-12-31 19:47:31 -05:00
Lincoln Lee
70302a4420 Check no_checksum if version is latest
Added one more check in audit if version is latest and have sha1 it will
not pass.
2013-12-30 20:46:11 +08:00
Dillon Benson
12cc9d4006 remove colon and add quotes to search not found message 2013-12-19 12:14:50 -05:00
Dillon Benson
fdf43d7873 change search results message 2013-12-19 12:03:42 -05:00
Dillon Benson
10d0feef27 shows that there are no casks matching a search term that did not result in anything 2013-12-19 00:02:38 -05:00
Paul Hinze
e46b89c908 Merge pull request #2081 from leoj3n/services-support
[WIP] services support
2013-12-15 15:26:44 -06:00
Paul Hinze
9c99f282e1 Merge pull request #2022 from rolandwalker/kext_check_unload
check if kext is present before attempting unload
2013-12-15 14:57:12 -06:00
Paul Hinze
36b0d166df make method_missing message much more explicit 2013-12-15 14:16:22 -06:00
Paul Hinze
ac50e9d65b Merge pull request #2107 from phinze/headers-integration
Headers integration
2013-12-15 11:27:25 -08:00
Paul Hinze
f6f507b289 some refactoring around the new download strategy
- move the interface from top-level methods to hash arguments of URL to
   keep the cask DSL as skinny as possible
 - promote the Cask::Headers object up to a Cask::URL object that
   encapsulates all infornation about the URL
 - pull all knowledge about curl arguments into the DownloadStrategy,
   leaving URL to act as a value object to be queried for details
 - test at the DownloadStrategy level; setting up expected curl args
   and example casks
2013-12-15 13:18:47 -06:00
Paul Hinze
24a53c4af7 Merge pull request #1944 from jonahoffline/add_headers_download_strategy
Add DownloadStrategy with custom :headers support
2013-12-14 09:13:58 -06:00
Paul Hinze
fd82e97fa1 Merge pull request #2085 from pstadler/master
Handle CaskAlreadyInstalledError more graceful
2013-12-14 07:10:22 -08:00
Paul Hinze
6fa34a8e3e Merge pull request #2051 from rolandwalker/uninstall_flags
flag handling consistent btw install/uninstall
2013-12-14 07:07:45 -08:00
Paul Hinze
0c6e97b8fd use absolute paths for all commands
closes #2029
2013-12-14 08:48:40 -06:00
Paul Hinze
4bfc09ec02 Merge pull request #2066 from halo/master
Configurable Caskroom location, see #475
2013-12-14 06:00:31 -08:00
Patrick Stadler
cb11080468 CaskAlreadyInstalledError exits with 0 2013-12-14 14:10:57 +01:00
future
e7d98677fe Added inline comment on option parser so that people won't forget about the documentation 2013-12-14 10:13:06 +01:00
Joel Kuzmarski
7432affc59 services support 2013-12-13 18:13:19 -06:00
Roland Walker
9b4805be4e Merge pull request #2026 from rolandwalker/safer_quit_uninst
safer test for currently running app
2013-12-13 13:54:38 -08:00
Paul Hinze
8870f7c1fc Merge pull request #2008 from kevinSuttle/colorpickers 2013-12-13 10:40:36 -06:00
Paul Hinze
0a0c4a2d8a remove use of caller 2013-12-13 08:56:59 -06:00
Jonah Ruiz
c92890ecc9 Refactor similar method structure in dirs and files into one for re-use.
By using the name of the method calling fs_command we remove duplication
2013-12-13 04:14:54 -04:00
Kevin Suttle
6dff4a35db Add support for colorpicker type 2013-12-12 22:59:58 -05:00
Jonah Ruiz
06be4b0d8e Add DownloadStrategy and Cask::Headers for custom :headers support
accepts a :user_agent argument and/or multiple :cookies
  headers :user_agent => 'Netscape/1.0', :cookies => { :cookey => "r00t" }

Also adds a standalone :fake_user_agent for a default UserAgent (Chrome)
  fake_user_agent
References #1175, #958
2013-12-12 21:29:12 -04:00
future
af408269cf Make caskroom configurable via command line argument 2013-12-12 12:31:57 +01:00
Roland Walker
ce4b83984c flag handling consistent btw install/uninstall
This makes uninstall process flag arguments in the same manner
as install. Any argument with a leading dash is assumed to be a
flag, not a Cask.  Argument processing still needs work, unknown
flags and spelling errors are silently accepted.
2013-12-11 17:15:33 -05:00
Roland Walker
be7cc838a7 safer test for currently running app
The previous version could fail if the specified bundle was not installed.
Here we tell "System Events" until determining it is safe to do otherwise.
2013-12-09 22:23:27 -05:00
Roland Walker
07b9eea19b refine & document order of uninstall keys
Proposed order - :script, :launchctl, :quit, :kext, :pkgutil, :files.  Quit
a process before attempting to unload an assocated kext, unload kext before
attempting to delete the associated file, etc.  Arguably :script fits
loically with :files near the end of the list.  However, we also have
:after_uninstall which implicitly fires immediately after :files.
Therefore, running :script early provides greater functionality.
2013-12-09 21:34:30 -05:00
Fernando Paredes
150c5bcf6f Merge pull request #2019 from rolandwalker/validate_uninstall_keys
validate keys given to :uninstall
2013-12-09 17:25:27 -08:00