* Change app artifact to move instead of link
First step towards change in installation behavior mentioned in [13201]
* Fix handling of binaries linked from inside of app bundles
Also adds `appdir` method for interpolation in stanzas
* Change appdir to root Applications directory
* Update 2-app tests
* Refactor: add options, ivars to `Installer`, `Download`
In preparation for upcoming changes, this commit cleans up some code. The commit includes:
- In order to reduce unnecessary object passing, make both the `force` and `skip_cask_deps` option into instance variables of the `Installer` class
- Introduce options hashes to initializers of both the `Installer` and `Download` class
- When the `install --force` command enters the fetch phase, make it explicit in the code that fetching is never enforced in that case.
- Update tests
* Force overwrite artifacts on `--force` reinstall
This commit changes the behavior of a `Moved` artifact such that if the target already exists, `brew cask install --force` will remove the existing target before moving the staged artifact.
In that case, the warning message will say *overwriting* instead of *not moving*.
The behavior of plain `brew cask install` remains unchanged; the same goes for the warning message for that case.
* Change remaining artifacts to move instead of symlink
* Update casks to use appdir in binary paths
* Forcibly overwrite artifacts, modifying flags and using `sudo` if needed
- This commit implements [the proposed behavior for `install --force`](https://github.com/caskroom/homebrew-cask/pull/13966#issuecomment-220830387) when a target already exists and has either permission problems or is not owned by the user.
- The changes apply only when the `force` option is given.
- Reused the existing safeguard from the `.pkg` artifact to prevent deleting important directories by bug or mistake
- The two existing blacklists `SYSTEM_DIRS` and `UNDELETABLE_DIRS` have been consolidated into the `Hbc::MacOS` module.
- `UNDELETABLE_DIRS` now also contains all the entries from `SYSTEM_DIRS` which was a to-do anyway.
- The two blacklists are now also frozen for good measure.
- The utility method `permissions_rmtree` was moved to `Hbc::Utils`.
- The `tried_permissions` part in `Utils` now falls back correctly when there are also ownership issues at the same time.
- Introduced a separate `current_user` method for mocking.
- Added an optional feature to `FakeSystemCommand` so it can now act as a proxy to `SystemCommand`.
- Added tests for various `permissions_rmtree` cases.
I always found the wording of the header in the readme confusing. e.g. Did homebrew cask used be installed by icon dragging? Do I install cask by dragging? Oh wait, its referring to what cask enables.
Care if we change the header to something more conventional and just include the concept as a pull quote?
Do not revert this PR after the transition period. It contains
a README banner which needs to be deleted later, but also a
persistent doc file and an unrelated whitespace nit.
global replace of:
'phinze/homebrew-cask' -> 'caskroom/homebrew-cask'
'phinze/cask' -> 'caskroom/cask'
'phinze/homebrew-testcasks' -> 'caskroom/homebrew-testcasks'
and various other specific places that needed updates
<3 the homebrew-cask community!
following up on #3094
- rename `THE_CASK_LANGUAGE.md` to `CASK_LANGUAGE_REFERENCE.md`
- expand `CASK_LANGUAGE_REFERENCE.md` to more fully specify the Cask DSL
- add sections: "Casks Are Ruby Classes" and "The Cask Language Is Declarative"
- import content from `FAQ.md` to `CASK_LANGUAGE_REFERENCE.md`, create multiple sections
listing all stanzas according to category.
- document which stanzas are permitted multiple times
- add previously undocumented `before_install` and `before_uninstall`
- doc that `Hardware::CPU.is_64_bit?` (and 32-bit) are acceptable in conditionals
- doc that `:target` may contain an absolute path (this works more reliably after #3075)
- doc that `uninstall` is optional in the DSL, but required by the community
- link examples
- standardize mixed language on "stanza" over "field"
- further shrink `CONTRIBUTING.md` by deleting rarely used stanzas
and referencing `CASK_LANGUAGE_REFERENCE.md`
Mostly this is spelling, capitalization, and whitespace. One
substantive change is updating the list of fields given in FAQ.md
to match CONTRIBUTING.md. Also incorporates suggestions from @NanoXD,
removing an old paragraph from FAQ.md re: nested containers.
By default, the mac file chooser won't list folders like /usr/,
add tip to readme about Cmd-Shift-G workaround.
Signed-off-by: Félix Saparelli <me@passcod.net>
Options can be passed on the command-line and/or using
the HOMEBREW_CASK_OPTS environment variable (which has
lowest priority). There is a single --appdir=PATH option
right now, but this commit enables future awesomeness!
Other minor changes:
* `brew cask help` now returns the same thing as `brew cask`
instead of saying there was “no such command as help”.
* The HEREDOC block now uses Homebrew's #undent instead of the
customed-rolled #gsub version. Cleaner and more flexible.
* `Cask.set_appdir` has been renamed to `Cask.appdir=`. This
is more Rubyish, and of little consequence (the only place
it was previously used was in the tests).
did the research to figure out in which HOMEBREW_VERSION the wild Tap
linking problem that we ran into in #37 was fixed.
hopefully this will prevent other folks from running into it.