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 2
2
# frozen_string_literal: true
3
3
4
4
require "cask/artifact/app"
5
+ require "cask/artifact/appimage"
5
6
require "cask/artifact/artifact" # generic 'artifact' stanza
6
7
require "cask/artifact/audio_unit_plugin"
7
8
require "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 /target
12
+ end
13
+ end
14
+ end
15
+ end
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ class Config
15
15
DEFAULT_DIRS = T . let (
16
16
{
17
17
appdir : "/Applications" ,
18
+ appimagedir : "~/Applications" ,
18
19
keyboard_layoutdir : "/Library/Keyboard Layouts" ,
19
20
colorpickerdir : "~/Library/ColorPickers" ,
20
21
prefpanedir : "~/Library/PreferencePanes" ,
@@ -47,6 +48,7 @@ def self.from_args(args)
47
48
args = T . unsafe ( args )
48
49
new ( explicit : {
49
50
appdir : args . appdir ,
51
+ appimagedir : args . appimagedir ,
50
52
keyboard_layoutdir : args . keyboard_layoutdir ,
51
53
colorpickerdir : args . colorpickerdir ,
52
54
prefpanedir : args . prefpanedir ,
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ class DSL
34
34
ORDINARY_ARTIFACT_CLASSES = [
35
35
Artifact ::Installer ,
36
36
Artifact ::App ,
37
+ Artifact ::AppImage ,
37
38
Artifact ::Artifact ,
38
39
Artifact ::AudioUnitPlugin ,
39
40
Artifact ::Binary ,
Original file line number Diff line number Diff line change @@ -63,6 +63,10 @@ def self.global_cask_options
63
63
description : "Target location for Applications " \
64
64
"(default: `#{ Cask ::Config ::DEFAULT_DIRS [ :appdir ] } `)." ,
65
65
} ] ,
66
+ [ :flag , "--appimagedir=" , {
67
+ description : "Target location for AppImages " \
68
+ "(default: `#{ Cask ::Config ::DEFAULT_DIRS [ :appimagedir ] } `)." ,
69
+ } ] ,
66
70
[ :flag , "--keyboard-layoutdir=" , {
67
71
description : "Target location for Keyboard Layouts " \
68
72
"(default: `#{ Cask ::Config ::DEFAULT_DIRS [ :keyboard_layoutdir ] } `)." ,
Original file line number Diff line number Diff line change 2
2
# frozen_string_literal: true
3
3
4
4
require "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