File tree Expand file tree Collapse file tree 7 files changed +53
-0
lines changed Expand file tree Collapse file tree 7 files changed +53
-0
lines changed Original file line number Diff line number Diff line change 22# frozen_string_literal: true
33
44require "cask/artifact/app"
5+ require "cask/artifact/appimage"
56require "cask/artifact/artifact" # generic 'artifact' stanza
67require "cask/artifact/audio_unit_plugin"
78require "cask/artifact/binary"
Original file line number Diff line number Diff line change 1+ # typed: strict
2+ # frozen_string_literal: true
3+
4+ require "cask/artifact/symlinked"
5+
6+ module Cask
7+ module Artifact
8+ class AppImage < Symlinked
9+ sig { params ( target : T . any ( String , Pathname ) ) . returns ( Pathname ) }
10+ def resolve_target ( target )
11+ config . appimagedir /name
12+ end
13+ end
14+ end
15+ end
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ class Config
1515 DEFAULT_DIRS = T . let (
1616 {
1717 appdir : "/Applications" ,
18+ appimagedir : "~/Applications" ,
1819 keyboard_layoutdir : "/Library/Keyboard Layouts" ,
1920 colorpickerdir : "~/Library/ColorPickers" ,
2021 prefpanedir : "~/Library/PreferencePanes" ,
@@ -47,6 +48,7 @@ def self.from_args(args)
4748 args = T . unsafe ( args )
4849 new ( explicit : {
4950 appdir : args . appdir ,
51+ appimagedir : args . appimagedir ,
5052 keyboard_layoutdir : args . keyboard_layoutdir ,
5153 colorpickerdir : args . colorpickerdir ,
5254 prefpanedir : args . prefpanedir ,
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ class DSL
3434 ORDINARY_ARTIFACT_CLASSES = [
3535 Artifact ::Installer ,
3636 Artifact ::App ,
37+ Artifact ::AppImage ,
3738 Artifact ::Artifact ,
3839 Artifact ::AudioUnitPlugin ,
3940 Artifact ::Binary ,
Original file line number Diff line number Diff line change @@ -63,6 +63,10 @@ def self.global_cask_options
6363 description : "Target location for Applications " \
6464 "(default: `#{ Cask ::Config ::DEFAULT_DIRS [ :appdir ] } `)." ,
6565 } ] ,
66+ [ :flag , "--appimagedir=" , {
67+ description : "Target location for AppImages " \
68+ "(default: `#{ Cask ::Config ::DEFAULT_DIRS [ :appimagedir ] } `)." ,
69+ } ] ,
6670 [ :flag , "--keyboard-layoutdir=" , {
6771 description : "Target location for Keyboard Layouts " \
6872 "(default: `#{ Cask ::Config ::DEFAULT_DIRS [ :keyboard_layoutdir ] } `)." ,
Original file line number Diff line number Diff line change 22# frozen_string_literal: true
33
44require "extend/os/linux/cask/installer" if OS . linux?
5+ require "extend/os/mac/cask/installer" if OS . mac?
Original file line number Diff line number Diff line change 1+ # typed: strict
2+ # frozen_string_literal: true
3+
4+ module OS
5+ module Mac
6+ module Cask
7+ module Installer
8+ extend T ::Helpers
9+
10+ requires_ancestor { ::Cask ::Installer }
11+
12+ MAC_INVALID_ARTIFACTS = [
13+ ::Cask ::Artifact ::AppImage
14+ ] . freeze
15+
16+ sig { void }
17+ def check_stanza_os_requirements
18+ return unless artifacts . any? do |artifact |
19+ MAC_INVALID_ARTIFACTS . include? ( artifact . class )
20+ end
21+
22+ raise ::Cask ::CaskError , "Linux is required for this software."
23+ end
24+ end
25+ end
26+ end
27+ end
28+
29+ Cask ::Installer . prepend ( OS ::Mac ::Cask ::Installer )
You can’t perform that action at this time.
0 commit comments